Introduction to Objects
Objects in JavaScript are used to store collections of key-value pairs. They are one of the most fundamental data structures in the language.
const person = {
name: "Alice",
age: 25,
isStudent: false
};
console.log(person.name); // Output: Alice
You can add or modify properties dynamically:
person.city = "New York";
person.age = 26;