Script Preparation code:
AخA
 
var array = Array.from(Array(100).keys());
var newElement = 888
Tests:
  • Unshift

     
    array.unshift(newElement)
  • Concat

     
    array = [newElement].concat(array)
  • Spread

     
    array = [newElement, ...array]
Rendered benchmark preparation results:

Suite status: <idle, ready to run>

Previous results

Experimental features:

  • Test case name Result
    Unshift
    Concat
    Spread

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: 4 years ago)
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.89 Safari/537.36
Chrome 84 on Windows
View result in a separate tab
Test name Executions per second
Unshift 34551.7 Ops/sec
Concat 987.8 Ops/sec
Spread 189.2 Ops/sec