JavaScript – Create, Read, and Modify JavaScript Object

JavaScript – Create, Read, and Modify JavaScript Object

Create JavaScript Object

JavaScript object can be created as follows:

 

Read JavaScript Object

To access the data inside the object, we can do like so:

We can also do it the other way:

 

Modify JavaScript Object

We can modify the object too. Let say we want to change the address of this person object. We can do as follows:

Or alternatively:

Either way, the result will be the same.

Leave a Reply

Your email address will not be published. Required fields are marked *