slice vs length - 1 (v15)

Revision 15 of this benchmark created on


Setup

var x = [1,2,3,4,54,1,2,,6,457,4,53,52,34,2,34,45,357,6325,3,5532,423,43,5325,42,542,6,3256,78,569,87,43,2,342,34,6,23,24,'1243']

Test runner

Ready to run.

Testing in
TestOps/sec
slice
var y = x.slice(-1)
ready
length - 1
var z = x;
var y = z[z.length - 1]
ready

Revisions

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