Update isprime.js

This commit is contained in:
Torma Kristóf 2019-04-26 15:38:09 +02:00 committed by GitHub
parent 8709174ac0
commit 0a7b4bd50d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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]) {