prime [ i ] will be true if i is a prime
let prime = Array . from ( { length : maxVal + 1 } , ( _ , i ) => 0 ) ; for ( let i = 0 ; i < prime . length ; i ++ ) prime [ i ] = true ; sieveOfEratosthenes ( prime , maxVal ) ;