What is the proper way to declare a JavaScript 2d array? I've tried doing this
var matrix = new Array(new Array(2), new Array(2));
but it doesn't want to work. I am complete javascript beginner so if you can please help me out.
Thanks in advance
Those brackets declare an empty, inline constructor. In that case, with them, the constructor does exist, it merely does nothing more than t...
No comments:
Post a Comment