so i am working with a json variable like this:
opponentInvData.item1
it contains items 1 through 6
i need to access the different items dynamically and set them to null. itemNum is the specific item i need to access. im trying to use the eval function
var itemNum = 2;
eval(opponentInvData.item + itemNum + ' = ""');
needless to say, it's not working, any ideas?
opponentInvData.itemin theevalcall, otherwise it will use the current value. You shouldn't use this approach regardless - just saying what is wrong with your code.