Program to check whether a number is prime or not. function isPrime(n) { // Check if the number is less than 2 // (prime numbers are greater than 1) if (n < 2) { return false; } // Check for divisibility by numbers // from 2 up to the square root of the number for (let i = 2; i <= Math.sqrt(n); i++) { if (n % i === 0) { // If the number is divisible by any // other number, it's not prime return false; } } // If the number is not divisible by any // other number, it's prime return true; } console.log(isPrime(197293));