Add New Properties in Object

Code Structure
var person = {
 firstName : "Bill",
 lastName : "Gates",
 age : 30,
 location : "UK"
};
person.occupation = "IT Manager";
alert(person.firstName + " works as a " + person.occupation + ".");

Share this

Related Posts