Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:122.0) Gecko/20100101 Firefox/122.0
Firefox 122
Windows
Desktop
2 years ago
Benchmark.js
Array.prototype.concat
9.4M/s
Array.prototype.push.apply()
1.2M/s
View exact numbers
| Test name |
Executions per second |
|
✓
Array.prototype.concat
|
9,357,486 Ops/sec |
|
spread operator
|
4,155,871 Ops/sec |
|
Array.prototype.push.apply()
|
1,194,246 Ops/sec |
|
Lodash concat
|
997,422 Ops/sec |
|
cached for + push
|
678,415 Ops/sec |
Tests:
-
Array.prototype.concat
-
Lodash concat
-
Array.prototype.push.apply()
-
spread operator
-
cached for + push