Ed

Processing data with chained array methods is the bread and butter of JavaScript. Let's build a pipeline that filters, transforms, and aggregates data.

Your Task:

  • Start with an array of transactions
  • Filter to only completed transactions
  • Map to extract just { id, total } from each
  • Use reduce to calculate the sum of all totals
  • Store results in completedTransactions and totalRevenue
TypeScript Solution
Loading...

Submit your code to see test results