Test case name | Result |
---|---|
1️⃣ Array.from | |
2️⃣ Array(10).fill().map() | |
3️⃣ for loop | |
4️⃣ while loop | |
5️⃣ do while loop | |
6️⃣ for of loop | |
7️⃣ es6 spread operator |
Test name | Executions per second |
---|---|
1️⃣ Array.from | 468044.8 Ops/sec |
2️⃣ Array(10).fill().map() | 1900099.5 Ops/sec |
3️⃣ for loop | 10616149.0 Ops/sec |
4️⃣ while loop | 11564314.0 Ops/sec |
5️⃣ do while loop | 11005315.0 Ops/sec |
6️⃣ for of loop | 2240681.0 Ops/sec |
7️⃣ es6 spread operator | 2182405.0 Ops/sec |