flatMap() vs filter().map()

flatMap vs filter map
one year ago
User agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/116.0
Test name Executions per second
filter().map() 745.1 Ops/sec
flatMap() 656.3 Ops/sec
Script Preparation code:
Tests:
  • filter().map()

  • flatMap()

Open this result on MeasureThat.net