Answers for "number is prime or not javascript"

1

number is prime or not javascript

function isPrime(num) {
  for(var i = 2; i < num; i++)
    if(num % i === 0) return false;
  return num > 1;
}
Posted by: Guest on August-24-2021

Code answers related to "number is prime or not javascript"

Code answers related to "Javascript"

Browse Popular Code Answers by Language