I want to create a two dimensional array in Javascript where I\'m going to store coordinates (x,y). I don\'t know yet how many pairs of coordinates I will have because they
One line solution:
var x = 3, y = 4; var ar = new Array(x).fill(new Array(y).fill(0));
It creates matrix array with values = 0