Run details:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/104.0.5112.102 Safari/537.36
Chrome 104
Mac OS X 10.15.7
Desktop
2 years ago
Test name Executions per second
Array.flat 684344.9 Ops/sec
reduce + concat 3148652.0 Ops/sec
reduce + destructure 4546566.0 Ops/sec
reduce + push 6985446.5 Ops/sec
lodash.flatten 4920980.5 Ops/sec
destructuring 4104983.2 Ops/sec
HTML Preparation code:
Script Preparation code:
Tests:
  • Array.flat

  • reduce + concat

  • reduce + destructure

  • reduce + push

  • lodash.flatten

  • destructuring