Array unshift vs prepend vs concat (v28)

Revision 28 of this benchmark created on


Test runner

Ready to run.

Testing in
TestOps/sec
Concat
a = [1, 2, 3, 4];
[0].concat(a);
ready
Prepend function
a = [1, 2, 3, 4];
a.unshift(0)
ready
Unshift without mutation
a = [1, 2, 3, 4];
a.slice(0).unshift(0);
ready

Revisions

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