Fixed error prone checking etc in codebase

This commit is contained in:
Angelos Chalaris
2018-02-04 17:48:07 +02:00
parent 6709e181d7
commit 3129126866
18 changed files with 25 additions and 25 deletions

View File

@ -8,7 +8,7 @@ Return `false` if any of them divides the given number, else return `true`, unle
```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 (var i = 2; i <= boundary; i++) if (num % i === 0) return false;
return num >= 2;
};
```