Last item method (v2)

Revision 2 of this benchmark created on


Setup

var array = [], i=0;
    for (i; i<1000; i++)
      array[i] = i;

Test runner

Ready to run.

Testing in
TestOps/sec
[array.length-1]
array[array.length-1];
ready
slice(-1)[0]
array.slice(-1)[0]
ready
pop()
array.pop()
ready
reverse()-0
array.reverse()[0]
ready

Revisions

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