src/modules/misc/utils.js
//returns true if it is a prime number else it returns false
returns true if it is a prime number else it returns false
returns true if it is a prime number else it returns false
function isPrime(n) {
    const sqrtnum = Math.floor(Math.sqrt(n));
    let prime = n != 1;
    for (let i = 2; i < sqrtnum + 1; i++) { 
        if (n % i == 0) {
            prime = false;
            break;
        }
    }
    return prime;
}
function isPrime ( n ) { const sqrtnum = Math . floor ( Math . sqrt ( n ) ) ; let prime = n != 1 ; for ( let i = 2 ; i < sqrtnum + 1 ; i ++ ) { if ( n % i == 0 ) { prime = false ; break ; } } return prime ; }
returns true if it is a prime number else it returns false
returns true if it is a prime number else it returns false
// sqrtnum + 1