splice vs slice (v6)

Revision 6 of this benchmark created on


Description

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

Revisions

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