Test case name | Result |
---|---|
1️⃣ Array.from() | |
2️⃣ Array() and fill() | |
3️⃣ for loop | |
4️⃣ while loop | |
5️⃣ do while loop | |
6️⃣ for of loop | |
7️⃣ ... spread operator, Array() and map() |
Test name | Executions per second |
---|---|
1️⃣ Array.from() | 501908.6 Ops/sec |
2️⃣ Array() and fill() | 1899939.9 Ops/sec |
3️⃣ for loop | 11281262.0 Ops/sec |
4️⃣ while loop | 11851864.0 Ops/sec |
5️⃣ do while loop | 11128064.0 Ops/sec |
6️⃣ for of loop | 2606430.5 Ops/sec |
7️⃣ ... spread operator, Array() and map() | 2181438.2 Ops/sec |