Run details:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:109.0) Gecko/20100101 Firefox/119.0
Firefox 119
Mac OS X 10.15
Desktop
one year ago
Test name Executions per second
new array 15202711.0 Ops/sec
mutation 33625660.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);