JavaScript Objects : Everything developers need to know

Adesina Mark
By -
0

objects-in-depth-javascript

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.


object-creation-syntax-javascript


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:

adding-properties-to-javascript-object



mmmm

Post a Comment

0Comments

Post a Comment (0)