Get last item from array (v11)

Revision 11 of this benchmark created on


Preparation HTML

<script>
var array = [1,2,3,5,4,6,85,2,5,7,4,4,4,234,23];
</script>

Test runner

Ready to run.

Testing in
TestOps/sec
array[array.length - 1]
array[array.length - 1];
ready
array.slice(-1)[0];
array.slice(-1)[0];
ready
array.slice().pop();
array.slice().pop();
ready
[].concat(array).pop();
[].concat(array).pop();
ready
array.push(v=array.pop())
array.push(v=array.pop())
ready

Revisions

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