To store the indices where 0 , 1 , 2 , 3 and 4 are present
let pos = new Array ( 5 ) ; for ( let i = 0 ; i < 5 ; i ++ ) { pos [ i ] = new Array ( 10000 ) ; for ( let j = 0 ; j < 10000 ; j ++ ) { pos [ i ] [ j ] = 0 ; } }