Reduce vs Map

Benchmark created on


Setup

var arr = new Array(10000).fill(1)

Test runner

Ready to run.

Testing in
TestOps/sec
Map
arr.map((v) => {
	return v+ 1
})
ready
Reduce
arr.reduce((acc, v) => {
	acc.push(v+ 1)
	return acc
}, [])
ready

Revisions

You can edit these tests or add more tests to this page by appending /edit to the URL.