S
scott.howe
Is there a way to add a property to a javascript object at runtime if
you don't the name until runtime?
For Example:
var oTestObj = new Object();
//In the real world the value of sPropertyName would be calculated.
var sPropertyName = "NewProperty";
//How do you add a property whos name is the value of sPropertyName?
oTestObj.NewProperty = "Somevalue";
you don't the name until runtime?
For Example:
var oTestObj = new Object();
//In the real world the value of sPropertyName would be calculated.
var sPropertyName = "NewProperty";
//How do you add a property whos name is the value of sPropertyName?
oTestObj.NewProperty = "Somevalue";