JavaScript Object Data Type with Example

JS Object Data Type

The object is a complex data type that allows us to store collections of data.

Undefined is also a primitive value in JavaScript. A variable or an object has an undefined value when no value is assigned before using it

JavaScript objects are written with curly braces {}.Object properties are written as name:value pairs, separated by commas.

Example:

Result:

JavaScript Objects
Rahul is 22 years old.


Read Also: