I have a 2D array which has 10 rows and 10 columns and I want to access a column's element from each row like this:
myArray[0][9]
myArray[1][4]
myArray[2][5]
myArray[3][9]
myArray[4][5]
myArray[5][9]
myArray[6][8]
myArray[7][9]
myArray[8][7];
myArray[9][8]
The code that I have used:
for(var i=0; i<theatregoers.length; i++)
{
myArray[i][9].position=true;
}
Note: I do not have any idea how to change column numbers like this each time when loop run. I do not want to use the nest loop, just using a single loop.