two - dimensional array to store numbers .
let arr = new Array ( rows ) ; for ( let i = 0 ; i < rows ; i ++ ) { arr [ i ] = new Array ( rows ) ; for ( let j = 0 ; j < columns ; j ++ ) { arr [ i ] [ j ] = 0 ; } } for ( let i = 0 ; i < rows ; i ++ ) {