Click in order · JavaScript and TypeScript course · Module 12: Functional Programming

filter-map-reduce Chain

Arrange the elements of a filter-map-reduce pipeline:

Items to click

  • data
  • .filter(d => d.active)
  • .reduce((sum, v) => sum + v, 0)
  • .map(d => d.value * 2)

You can check the correct answer by solving this task in the CodeWorlds game.