Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
a[n] | n in a | a.length-1==n | a.at(-1)==a[n]
(version: 0)
Comparing performance of:
a[n] vs n in a vs a.length-1==n vs a.at(-1)==a[n]
Created:
3 years ago
by:
Guest
Jump to the latest result
Tests:
a[n]
let a=[4,8,15,16,23,42],n=5; (a[n])&&(a.li=a[n])
n in a
let a=[4,8,15,16,23,42],n=5; (n in a)&&(a.li=a[n])
a.length-1==n
let a=[4,8,15,16,23,42],n=5; (a.length-1==n)&&(a.li=a[n])
a.at(-1)==a[n]
let a=[4,8,15,16,23,42],n=5; (a.at(-1)==a[n])&&(a.li=a[n])
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (4)
Previous results
Fork
Test case name
Result
a[n]
n in a
a.length-1==n
a.at(-1)==a[n]
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!
Related benchmarks:
arr.sort((a, b) => a - b)[0] vs. Math.min(...arr)
testing--js
Test reverse map and forEach
test for and forEach
spread vs concat vs unshift vs flat v2
Comments
Confirm delete:
Do you really want to delete benchmark?