Properties of an object can be defined dynamically after its creation : Properties « Object Oriented « JavaScript Tutorial






var myHourse = new Object;
myHourse.color = "red";
myHourse.doors = 4;
myHourse.showColor = function () {
    alert(this.color);
};








25.5.Properties
25.5.1.Properties of an object can be defined dynamically after its creation
25.5.2.Factory Paradigm
25.5.3.Passing in of default values for the various properties in Object creation function