Run details:
Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.120 YaBrowser/19.10.1.238 Yowser/2.5 Safari/537.36
Yandex Browser 19
Windows
Desktop
5 years ago
Test name Executions per second
Array.prototype.slice [direct call] 5323419.5 Ops/sec
Array.prototype.slice [saved function call] 2754165.0 Ops/sec
Array.prototype.concat [direct call] 2908733.2 Ops/sec
Array.prototype.concat [saved function call] 1889076.0 Ops/sec
Spread operator 5096527.5 Ops/sec
Script Preparation code:
Tests:
  • Array.prototype.slice [direct call]

  • Array.prototype.slice [saved function call]

  • Array.prototype.concat [direct call]

  • Array.prototype.concat [saved function call]

  • Spread operator