Spread vs Concat Array
Date tested:
4 years ago
User agent:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.138 Safari/537.36
Test name
Executions per second
concat
2783280.2 Ops/sec
spread
4650483.0 Ops/sec
Benchmark definition (click to collapse):
Script Preparation code:
var k =[1,2]; var m = [5];
Tests:
concat
var n = k.concat(m)
spread
var n = [...k, ...m]
Open this result on MeasureThat.net