Skip to main content

Practice · 1 of 2

Group and Sum with reduce

CHALLENGE
Difficulty: intermediate+25 XP

Given orders (an array of { user, total } objects, already declared in the boilerplate), write sumByUser(orders) that RETURNS an object mapping each user to the sum of their totals. Use reduce — no for loops.

Back to lesson: Practice: Transforming Data — Practice