Fork me on GitHub

WorkWork Demo

Finding the nthPrime | Finding the nth Fibonacci Number | Vs Parallel.JS


Array.prototype.map

arr.map(function (elem, i) {
	return nthPrime(elem);
});

//returns a new array with nth prime numbers as elements

WorkWork.map

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