Run details:
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4412.3 Safari/537.36
Chrome 90
Linux
Desktop
3 years ago
Test name Executions per second
reduce + Array.prototype.concat 2001711.1 Ops/sec
Array.prototype.flat 626655.4 Ops/sec
Manual copy by index #1 424848.1 Ops/sec
Manual copy by index #2 1155193.0 Ops/sec
Manual copy with push 2052079.4 Ops/sec
Script Preparation code:
Tests:
  • reduce + Array.prototype.concat

  • Array.prototype.flat

  • Manual copy by index #1

  • Manual copy by index #2

  • Manual copy with push