HashMap & Set

Group By Property

easy
Given an array of objects `items` and a string `key`, group items by `item[key]`. Return a plain object whose keys are the property values (stringified) and values are arrays of matching items (preserve input order). Example: `groupBy([{type:"a",v:1},{type:"b",v:2},{type:"a",v:3}], "type")` → `{ a: [...], b: [...] }`.
Hint steps(0/3 revealed)
  1. 1

    Complete previous step or reveal to unlock this hint.

  2. 2

    Complete previous step or reveal to unlock this hint.

  3. 3

    Complete previous step or reveal to unlock this hint.