Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

prime or not in javascript

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: #prime #javascript
ADD COMMENT
Topic
Name
1+5 =