spread vs apply

Benchmark created on


Description

compares arr.push(...values); and arr.push.apply(arr, values);

Setup

const arr = [];
const values = new Array(100).fill(0);

Test runner

Ready to run.

Testing in
TestOps/sec
spread
arr.push(...values);
ready
apply
arr.push.apply(arr, values);
ready

Revisions

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