splice vs slice (v11)

Revision 11 of this benchmark created on


Description

Check what's better to remove an element 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(4)
ready
splice
a = [1, 2, 3, 4, 5, 6, 7];
a.splice(4);
ready

Revisions

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