Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
arrayLast
(version: 0)
Comparing performance of:
b=a[a.length-1] vs b=a.slice(-1)[0] vs b=a[-1]
Created:
2 years ago
by:
Guest
Jump to the latest result
Script Preparation code:
var a=[0,1,2,3,4,5,6,7,8,9,8,7,6,5,4,3,2,1]
Tests:
b=a[a.length-1]
b=a[a.length-1]
b=a.slice(-1)[0]
b=a.slice(-1)[0]
b=a[-1]
b=a[-1]
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (3)
Previous results
Fork
Test case name
Result
b=a[a.length-1]
b=a.slice(-1)[0]
b=a[-1]
Fastest:
N/A
Slowest:
N/A
Latest run results:
No previous run results
This benchmark does not have any results yet. Be the first one
to run it!
Comments
Confirm delete:
Do you really want to delete benchmark?