This site is mobile accessible. Press the "Tap Here" button to use a different font-size.


Smartphone icons created by Freepik - Flaticon

Modify a JavaScript Object

// create myObj
const myObj = {name:"John", age:30, city:"New York"};

// modify myObj["name"]
myObj["name"] = "Gilbert";
document.getElementById("demo").innerHTML = myObj.name;