Iterating through the array to find the maximum element in the array
for ( let x = 0 ; x < path . length ; x ++ ) { if ( max < path [ x ] ) max = path [ x ] ; } for ( let i = 0 ; i * prime [ i ] <= parseInt ( max / 2 , 10 ) ; i ++ ) { let ct = 0 ;