This is checked so that we can skip the middle five numbers in the below loop
if ( n % 2 == 0 n % 3 == 0 ) return true ; let i = 5 ; while ( i * i <= n ) { if ( n % i == 0 || n % ( i + 2 ) == 0 ) return true ; i = i + 6 ; } return false ; }