Published
- 1 min read
js isprome
The solution for this is noted below
js isprome
Solution
function isPrime(n) {
for (let i = 2; i < n; i++) {
if (n % i === 0) return false
else continue
}
return true
}
Try other methods by searching on the site. That is if this doesn’t work