Your files never leave your device
Advertisement

Objects

Objects are collections of key-value pairs. While arrays are good for ordered lists, objects are perfect for describing complex entities.

Creating Objects

You access an object's properties using dot notation (.) or bracket notation ([]).

Try It Yourself

        

Updating Objects

You can easily add new properties or update existing ones, even if the object was declared with const.

Try It Yourself

        

Practice

Challenge 1: Create an object representing a book with title, author, and pages properties.

Related Guides

Sponsored Utility
While You're Here
Sponsored Recommendations
Advertisement