Account
Categories

Object


Definition:

If you use the object datatype in your program, then it stores multiple related values as key-value pairs in a variable.

This is called the object data type.

Syntax:

let objectName = { key: value };

Example:

let person = {
  name: "Shobha",
  age: 25,
  city: "Delhi"
};

Here, a person is an object that stores multiple values.

Output: