map vs forEach

Benchmark created on


Setup

const data = [...Array(1000).keys()]

Test runner

Ready to run.

Testing in
TestOps/sec
forEach
data.forEach(x => {console.log(x)})
ready
map
data.map(x => {console.log(x)})
ready

Revisions

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