Hello,
I would like to create dynamic variable name and assign values to them.
Something like this:
var item1 = “adf”;
var item2 = “wer”;
:
var item’n’ = “xyz”;
i want to create these names dynamically.
i tried: var item{i} where i is the dynamic variable.
var item[i]
var item(i)
nothing seems to be working.
I also tried:
eval(‘item’+i) - it gives ‘item1’ is undefined.
It doesnt recognize : var eval(‘item’+i)
Any idea ??
Thanks
J