Practice · 2 of 3
Keyed Group-By
CHALLENGE
Difficulty: intermediate+25 XP
Write groupBy(items, keyFn) RETURNing an object mapping each key to the array of items with that key (order preserved within groups). Write keyCount(groups) that takes the result and returns the number of distinct keys.
Press Submit to check your solution.
Back to lesson: Practice: Generics — Practice