arr.map(function (elem, i) {
return nthPrime(elem);
});
//returns a new array with nth prime numbers as elements
WorkWork.map(function (elem, i) {
return nthPrime(elem);
})
.then(function (resultArr) {
console.log(resultArr);
})
//logs a new array with nth prime numbers as elements
Method | Time (ms) |
---|---|
Native | |
WorkWork |