Run details:
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.82 Safari/537.36
Chrome 89
Linux
Desktop
3 years ago
Test name Executions per second
new array 31211530.0 Ops/sec
mutation 11563155.0 Ops/sec
Tests:
  • new array

    AخA
     
    const arr = [1, 2, 3, 4, 5, 6, 7, 8, 9];
    const arr1 = [0, ...arr];
  • mutation

     
    const arr = [1, 2, 3, 4, 5, 6, 7, 8, 9];
    arr.unshift(0);