Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/107.0.0.0 Safari/537.36
Chrome 107
Windows
Desktop
2 years ago
Test name Executions per second
concat multiple 1000.7 Ops/sec
concat 1 1001.0 Ops/sec
Tests:
  • concat multiple

    x
     
    const arr1 = Array.from({ length: 5000}).map((_, i) => i);
    const arr2 = Array.from({ length: 5000}).map((_, i) => i);
    const arr3 = Array.from({ length: 5000}).map((_, i) => i);
    const finallArr1 = arr1.concat(arr2).concat(arr3);
  • concat 1

     
    const arr1 = Array.from({ length: 5000}).map((_, i) => i);
    const arr2 = Array.from({ length: 5000}).map((_, i) => i);
    const arr3 = Array.from({ length: 5000}).map((_, i) => i);
    const finallArr1 = arr1.concat(arr2, arr3);