so i work with json variable like this:
opponentInvData.item1
contains items 1 to 6
I need to dynamically access various elements and set them to null. itemNum is the specific item I need. im trying to use eval function
var itemNum = 2;
eval(opponentInvData.item + itemNum + ' = ""');
Of course, it does not work, any ideas?
source
share