Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

create multidimensional array javascript for loop

var squares = new Array();
for(var i = 0; i <= 8; i++)
{
    squares[i] = new Array();
    for(var j = (i * 20) + 1; j <= 20 * i + 20; j++)
        if (squares[i] == null)
            squares[i] = j;
        else
            squares[i].push(j);
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #create #multidimensional #array #javascript #loop
ADD COMMENT
Topic
Name
3+7 =