new Array() vs Array.from()Fastest: new Array() (27.3x faster)
1,912,112 ops/sec
70,106 ops/sec
Fastest: new Array() (1.8x faster)
662,500 ops/sec
371,389 ops/sec
Fastest: new Array() (2.1x faster)
1,686,720 ops/sec
821,940 ops/sec
Results show median performance across all community submissions. Run this benchmark yourself to verify on your device.
| Test case name | Result |
|---|---|
| new Array() | |
| Array.from() |
| Test name | Executions per second |
|---|---|
| ✓ new Array() | 2,677,257 Ops/sec |
| Array.from() | 73,448 Ops/sec |