Objects In JavaScript

Amina laabidi
May 25, 2021

--

Key/Value

In the object we will describe diferent aspects of our animal like its color its height its weight. These aspects are called keys and give them a value we speak of :

key-value

Example

Generality

Objects are used to model real world objects,we want to represent in our program.
In Javascript an object will be stored in a variable and written between
curlybraces. { }

Access to values

To access a value nothing could be simpler.. :)

Modify object

Here in our example we change the value color
We could also add a value which did not exist before ,eyes its added now

Functions

we can add functions to the objects (we speak of a method to use the data)

--

--

Amina laabidi
Amina laabidi

Written by Amina laabidi

I am a full-stack web developer javascript specialist Front-End

No responses yet