pop vs slice (v4)

Revision 4 of this benchmark created on


Description

What is the fastest way to remove the last element of an array and return what remains.

Preparation HTML

<script>
  var l = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
</script>

Test runner

Ready to run.

Testing in
TestOps/sec
shift
l.shift();
ready
slice
l.slice(1);
ready

Revisions

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