Array From vs new Array vs Array vs for push vs for index vs WhileFastest: new Array (1.2x faster)
15,044 ops/sec
14,921 ops/sec
14,298 ops/sec
14,243 ops/sec
13,005 ops/sec
12,967 ops/sec
Results show median performance across all community submissions. Run this benchmark yourself to verify on your device.
| Test case name | Result |
|---|---|
| Array From | |
| new Array | |
| Array | |
| for push | |
| for index | |
| While |
| Test name | Executions per second |
|---|---|
| ✓ new Array | 15,203 Ops/sec |
| Array | 14,871 Ops/sec |
| Array From | 14,253 Ops/sec |
| While | 14,121 Ops/sec |
| for push | 12,917 Ops/sec |
| for index | 12,759 Ops/sec |