adding key value pairs in an array in javascript code example
Example: add new key value pair to object javascript
const person = {
name: "Elon Musk"
}
person.age = 49;
console.log(person);
// {name: "Elon Musk", age: 49}
const person = {
name: "Elon Musk"
}
person.age = 49;
console.log(person);
// {name: "Elon Musk", age: 49}