How to add dynamic attribute to an object, for example I use the following code to add index (index)attribute to myObj, index is a variable.
var myObj={};
for(var index=0; index<10; index++){
myObj[index]='my'+index;
}
But it does not work...