forEach push vs map destruct push

Benchmark created on


Setup

const list = Array.from(Array(9).keys());
const result = [];

Test runner

Ready to run.

Testing in
TestOps/sec
forEach push
list.forEach(item => {
  result.push(item);
});
ready
map destruct push
result.push(...list.map(item => item));
ready

Revisions

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