Javascript implementation of the above approach
let matrix = new Array ( ) ; for ( let i = 0 ; i < 100 ; i ++ ) { let temp = new Array ( ) ; for ( let j = 0 ; j < 100 ; j ++ ) { temp . push ( [ ] ) } matrix . push ( temp ) }