In this article, we'll be looking into working with Objects in JavaScript - creating objects, modifying objects properties, accessing object properties, and much more.
What is Javascript Object
An object in JavaScript is a collection of related data. They are used to store keyed collections of various data. It contains variables and functions - properties and methods.
Creating a JavaScript Object
JavaScript objects can be created by declaring a variable using the object literal syntax or using the Object constructor syntax with optional properties.
Adding Properties
Properties can be added immediately as key-value pairs. This can be done in several ways:
They can be added to the curly braces like so:
mmmm




Post a Comment
0Comments