Codility/10.4_peak.js
// If A's length(N) is prime number and has peak, return 1
If A's length(N) is prime number and has peak, return 1
If A ' s length ( N ) is prime number and has peak return 1
function isPrime(num) {
    let result = false;
    for(let i = 2; i <= Math.floor(Math.sqrt(num)); i++) {
      if(num % i === 0){
        result = false;
        break;
      } 
      result = true;
    }
    return result;
  }
function isPrime ( num ) { let result = false ; for ( let i = 2 ; i <= Math . floor ( Math . sqrt ( num ) ) ; i ++ ) { if ( num % i === 0 ) { result = false ; break ; } result = true ; } return result ; }
If A's length(N) is prime number and has peak, return 1
If A ' s length ( N ) is prime number and has peak return 1