add value data pair to object 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}