groupBy()
Groups objects into arrays keyed by the value of a specified property.
Kind: global function
Returns: Object - An object where each key is a distinct property value and each
value is an array of matching objects.
| Param | Type | Description |
|---|---|---|
| objects | Array.<Object> | The array to group. |
| groupByProperty | string | The property whose value becomes the group key. |
Example
const byKind = ARM.groupBy(addresses, 'attributes.kind')
// { home: [...], office: [...] }Last updated on