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.
Since objects in javascript are associative arrays, adding a dynamic property is simply mapping a key/value pair. So perhaps the technical term you're looking for is probably related to assigning/mapping (terms that are related to associative arrays instead of the dynamic object).