JavaScript
Group Array by Key
Groups an array of objects into a map keyed by the result of a callback or property name. Uses Object.groupBy when available (ES2024) and falls back to a reduce implementation. Returns an object whose keys are the group names and values are arrays of matching items.