set property of object javascript code example
Example 1: js change value in object
var object = { boo:true, baa:5 };
console.log(object);
function change() {
object.boo = false;
object.baa++;
};
change();
console.log(object);
//Hope this helps!
Example 2: js create object with properties
var mycar = new Car('Eagle', 'Talon TSi', 1993);
Example 3: js create object with properties
function Car(make, model, year) {
this.make = make;
this.model = model;
this.year = year;
}