Run details:
Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:61.0) Gecko/20100101 Firefox/61.0
Firefox 61
Ubuntu
Desktop
6 years ago
Test name Executions per second
.unshift() 366805.5 Ops/sec
.push() 19005540.0 Ops/sec
.push() preallocated array 19603700.0 Ops/sec
.unshift() preallocated array 7276.8 Ops/sec
Script Preparation code:
Tests:
  • .unshift()

  • .push()

  • .push() preallocated array

  • .unshift() preallocated array