In Javascript you add properties to an object dynamically for example:
var car = {colour: "blue"};
car.reg = "XYXABC00D";
Is there a special buzzword for this?
Thanks.
In Javascript you add properties to an object dynamically for example:
var car = {colour: "blue"};
car.reg = "XYXABC00D";
Is there a special buzzword for this?
Thanks.
Your buzzword might be called the expando.
Well, in javascript, any object is an expando object. What it means is, as the article covers, that whenever you try to access a property it will automatically be created.
In practice the name "expando" is only used when a dynamic property added to a DOM node, which made "funny" things in ancient Internet Explorer versions.
date property to object o"? :)