Reputation: 15836
I have an object which is a member of an array called parameters , and the this object has a property called item_ , now if I assign a value to that property , how can I call it ?
for(ss=0;ss<=parameters[gpc].children_count-1;ss++)
{
parameters[gpc]['item_'+ss]="hello";
//console.log(parameters[gpc].item_0)
parameters[gpc].message+="\t\t<item value=""+parameters[gpc].item_+ss+"" />"
}
I tried eval() but in vain.
Upvotes: 0
Views: 39
Reputation: 5008
You can try and access it as associative array value:
var x = parameters[gpc]['item_' + ss];
Just like you assign the value.
Upvotes: 3