unshift vs splice

Benchmark created on


Test runner

Ready to run.

Testing in
TestOps/sec
unshift
const array = [1, 2, 3, 4];
array.unshift(0);
ready
splice
const array = [1, 2, 3, 4];
array.splice(0, 0, 0);
ready

Revisions

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