MyCave

Primer Numbers

function isPrime(number){
    while(number > 0 ) {
        if(number%2===0 || number%3===0){
            return false;
        }else{
            return true;
        }
        number--;
    }
    if( number === 0){
        return false;
    }
    return true;
}

function nextPrime(number) {
    number++;
    while(number > 0 ) {
        if(number%2!==0 && number%3!==0){
            return number;
        }
        number++;
    }
}