Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
JS Push vs Unshift
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:145.0) Gecko/20100101 Firefox/145.0
Browser:
Firefox 145
Operating system:
Mac OS X 10.15
Device Platform:
Desktop
Date tested:
5 months ago
Test name
Executions per second
.push()
5232815.0 Ops/sec
.unshift()
4856.5 Ops/sec
Script Preparation code:
const arr = []
Tests:
.push()
arr.push({name: "lorem1", label: "lorem1"}, {name: "lorem2", label: "lorem2"}, {name: "lorem3", label: "lorem3"})
.unshift()
arr.unshift({name: "lorem1", label: "lorem1"}, {name: "lorem2", label: "lorem2"}, {name: "lorem3", label: "lorem3"})