Skip to content

Object Literals

An object literal is a comma‑separated list of key‑value pairs wrapped in curly braces {}. It is the simplest way to create an object in JavaScript.

const person = {
name: "Alice",
age: 30,
job: "Engineer",
};
console.log(person.name); // Alice