Toggle navigation
MeasureThat
.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
Array slice vs for loop
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (Android 14; Mobile; rv:132.0) Gecko/132.0 Firefox/132.0
Browser:
Firefox Mobile 132
Operating system:
Android
Device Platform:
Mobile
Date tested:
one year ago
push
73.0M/s
slice
37.4M/s
View exact numbers
Test name
Executions per second
✓
push
72,992,888 Ops/sec
slice
37,403,328 Ops/sec
Script Preparation code:
var data = [1, 2, 3, 4, 5, 6, 7, 8, 9, 0];
Tests:
slice
var copy = data.slice(3, 8);
push
var copy = []; for (var i = 3; i < 8; i++) { copy.push(data[i]) }