splice vs slice (v4)

Revision 4 of this benchmark created on


Description

Check what's better to remove first few items from an array

Preparation HTML

<script>
  var a;
</script>

Test runner

Ready to run.

Testing in
TestOps/sec
slice
a = [1, 2, 3, 4, 5, 6, 7];
a = a.slice(0,3)
ready
splice
a = [1, 2, 3, 4, 5, 6, 7];
a = a.splice(0,3)
ready

Revisions

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