Create an array to store counts . The size of array is limit + 1 and all values are initially 0
let count = new Array ( limit + 1 ) ; for ( let i = 0 ; i < count . length ; i ++ ) { count [ i ] = 0 ; }