.unshift() vs .push() + reverse()Fastest: .push() + reverse() (9.1x faster)
2,614,305 ops/sec
287,124 ops/sec
Results show median performance across all community submissions. Run this benchmark yourself to verify on your device.
| Test case name | Result |
|---|---|
| .unshift() | |
| .push() + reverse() |
| Test name | Executions per second |
|---|---|
| ✓ .push() + reverse() | 4,953,966 Ops/sec |
| .unshift() | 396,090 Ops/sec |