javascript - What is the location of x and y -
what location of x , y in array:
var = [ [1,2], [x], [3, [y]] ];
i'm bit confused syntax here.
be:
a[1] = x , a[2][1] = y?
or introduction of new set of square brackets mean instead have:
a[1][0] = x , a[2][1][0] = y?
let's find out ;)
var = [ [1,2], [x], [3,[y]]];
if write line line:
var = [ [1,2], // new array index 0 containing 1 , 2 => a[0][0] = 1 , a[0][1] = 2 [x], // new array index 1 containing x => a[1][0] = x [3,[y]] // new array index 2 containing 3 , array containing y a[2][0] = 3 a[2][1][0] = y ];
in other words, x = a[1][0]
Comments
Post a Comment