Update isPrime.md
This commit is contained in:
@ -11,7 +11,7 @@ Checks if the provided integer is a prime number.
|
||||
```js
|
||||
const isPrime = num => {
|
||||
const boundary = Math.floor(Math.sqrt(num));
|
||||
for (var i = 2; i <= boundary; i++) if (num % i === 0) return false;
|
||||
for (let i = 2; i <= boundary; i++) if (num % i === 0) return false;
|
||||
return num >= 2;
|
||||
};
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user