Toggle navigation
MeasureThat
.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
Slice vs Index
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:126.0) Gecko/20100101 Firefox/126.0
Browser:
Firefox 126
Operating system:
Ubuntu
Device Platform:
Desktop
Date tested:
one year ago
Array Index
90.3M/s
Array Slice
29.9M/s
View exact numbers
Test name
Executions per second
✓
Array Index
90,297,584 Ops/sec
Array Slice
29,889,150 Ops/sec
Tests:
Array Slice
const array = ['test','123','123','last']; const lastItem = array.slice(-1)[0];
Array Index
const array = ['test','123','123','last']; const lastItem = array[array.length - 1];