just-is-prime
Advanced tools
Comparing version 2.1.1 to 2.2.0
# just-is-prime | ||
## 2.2.0 | ||
### Minor Changes | ||
- Skip even numbers when looking for primes | ||
## 2.1.1 | ||
@@ -4,0 +10,0 @@ |
@@ -25,3 +25,7 @@ module.exports = isPrime; | ||
for (var i = 2; i <= Math.sqrt(number); i++) { | ||
if (number % 2 === 0) { | ||
return (number === 2); | ||
} | ||
for (var i = 3; i <= Math.sqrt(number); i += 2) { | ||
if (number % i === 0) { | ||
@@ -28,0 +32,0 @@ return false; |
{ | ||
"name": "just-is-prime", | ||
"version": "2.1.1", | ||
"version": "2.2.0", | ||
"description": "Check if number is prime", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
Sorry, the diff of this file is not supported yet
4737
84