Update isprime.js
This commit is contained in:
parent
8709174ac0
commit
0a7b4bd50d
@ -7,7 +7,7 @@ module.exports = {
|
|||||||
var upper = Math.sqrt(num);
|
var upper = Math.sqrt(num);
|
||||||
var sieve = new Array(num)
|
var sieve = new Array(num)
|
||||||
.join(',').split(',') // get values for map to work
|
.join(',').split(',') // get values for map to work
|
||||||
.map(function(){ return true });
|
.map(function(){ return "Prime" });
|
||||||
|
|
||||||
for (var i = 2; i <= num; i++) {
|
for (var i = 2; i <= num; i++) {
|
||||||
if (sieve[i]) {
|
if (sieve[i]) {
|
||||||
|
Loading…
Reference in New Issue
Block a user