write javascript function7. that accepts a number as a parameter and check the number is prime or not. code example
Example: prime numbers javascript
function isPrime(num) {
for (let i = 2; i * i <= num; i++)
if (num % i === 0)
return false;
return num > 1;
}