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 1937955.5 Ops/sec
Array.prototype.flat 602200.2 Ops/sec
Manual copy by index #1 418140.8 Ops/sec
Manual copy by index #2 1179810.5 Ops/sec
Manual copy with push 2007030.1 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