JS

JavaScript Code Output Challenge - Function isprim...

10.

What is the output of the following code?

function isPrime(number) {
  if (number <= 1) return false;
  for (let i = 2; i <= Math.sqrt(number); i++) {
    if (number % i === 0) return false;
  }
  return true;
}

console.log(isPrime(7));

Error

undefined

false

true