Adding element to array (v2)

Revision 2 of this benchmark created on


Setup

const a = [1,2,3,4];
const b = 5;

Test runner

Ready to run.

Testing in
TestOps/sec
Spread
const c = [...a, b];
ready
Concat
const c = a.concat(b);
ready
Splice
const c = a.toSpliced(a.length, 0, b);
ready

Revisions

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