How to work with objects in javascript?

Objects in JavaScript are collections of key-value pairs.

Example:


  let person = {
      name: "John",
      age: 30,
      city: "New York"
  };
  console.log(person.name);  // Outputs: John
  

Beginner's Guide to JavaScript