I'm using https://js.do/ as a sandbox for simple scripts and document.write
to print results. I'm working with multidimensional arrays, with code such as
var x = [];
x[1, 2] = 0;
However, I'm a little confused on what exactly document.write
is printing.
On researching multidimensional arrays in JS, I found no mention of the notation used above, but rather x[1][2]
was used in the examples found instead (ie. an array inside of an array).
I can't remember where I first came across the above way of using multidimensional arrays - perhaps someone could provide a link to enlighten me?