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
8.4M/s
Array.prototype.push.apply()
1.2M/s
View exact numbers
| Test name |
Executions per second |
|
✓
Array.prototype.concat
|
8,415,649 Ops/sec |
|
spread operator
|
3,820,791 Ops/sec |
|
cached for + push
|
1,429,270 Ops/sec |
|
Array.prototype.push.apply()
|
1,179,303 Ops/sec |
|
Lodash concat
|
980,634 Ops/sec |
Tests:
-
Array.prototype.concat
-
Lodash concat
-
Array.prototype.push.apply()
-
spread operator
-
cached for + push