Groups works by a specified property key.
Array of works to group
Property key to group by (e.g., 'type', 'publicationYear')
Object mapping group keys to arrays of works
Works with undefined values for the grouping key are placed in the 'unknown' group.
const byType = groupBy(works, 'type');const byYear = groupBy(works, 'publicationYear'); Copy
const byType = groupBy(works, 'type');const byYear = groupBy(works, 'publicationYear');
Groups works by a specified property key.