Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

js is prime

function isPrime(num) {
  for(var i = 2; i < num; i++){
    if(num % i === 0){ 
      return false;
    }
  }
  return num > 1;
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #js #prime
ADD COMMENT
Topic
Name
4+7 =