I have a set of variables which represent prices and number of items sold in a 2d array. I have sorted it in order to find the lowest price.
I'd like to set the second variable (number sold) of the first item (player A) to a value (200) by referring to the array.
For example:
var playerASold;
var arr=[
[playerAPrice,playerASold],
[playerBPrice,playerBSold],
[playerCPrice,playerCSold]];
arr[0][1]=200;
this doesn't work, probably because playerASold
currently has a value of 0 and it is trying to set 0=0.
How do I refer to the variable and not the value of the variable?