For vs map

Benchmark created on


Setup

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

Test runner

Ready to run.

Testing in
TestOps/sec
For of loop
const newData = []

for(const d of data) {
  newData.push(d)
}
ready
Map
const newData = data.map(d => d)
ready

Revisions

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