spread vs push 2
Date tested:
one year ago
User agent:
Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:109.0) Gecko/20100101 Firefox/116.0
Test name
Executions per second
spread
683625.8 Ops/sec
push
842612.4 Ops/sec
Benchmark definition (click to collapse):
Tests:
spread
const arr = [...new Array(30)].map((v, i) => i); const result = [...arr, 30];
push
const arr = [...new Array(30)].map((v, i) => i); const result = arr.push(30);
Open this result on MeasureThat.net