Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
slice vs get by index
Comparison of Array.prototype.slice and manually getting items by index
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/132.0.0.0 Safari/537.36
Browser:
Chrome 132
Operating system:
Windows
Device Platform:
Desktop
Date tested:
one year ago
Test name
Executions per second
slice
30231818.0 Ops/sec
get by index
84268816.0 Ops/sec
Script Preparation code:
var array = [1,2,3,4,5]
Tests:
slice
var newArray = array.slice(1, 4)
get by index
var newArray = [array[1], array[2], array[3]]