GroupBy returns a sequence of objects that match the key value for the grouping.
GroupBy
var result = persons.reduce((previous, person) => { (previous[person.lastname] = previous[person.lastname] || []).push(person); return previous; }, []);
For the contact, copyright, license, warranty and privacy terms for the usage of this website please see the contact, license, privacy, copyright.