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
Objects in JavaScript are collections of key-value pairs. Example:How to work with objects in javascript?
let person = {
name: "John",
age: 30,
city: "New York"
};
console.log(person.name); // Outputs: John