3 ms·
It looks like they are also creating a "groupByToMap" for that reason. See: https://github.com/tc39/proposal-array-grouping https://github.com/tc39/proposal-arr
by shawnz 5y ago
It looks like they are also creating a "groupByToMap" for that reason. See: https://github.com/tc39/proposal-array-grouping https://github.com/tc39/proposal-array-grouping
Property keys can also be symbol objects and it seems like that's supported by the groupBy function in addition to strings, see: https://tc39.es/proposal-array-grouping/ https://tc39.es/proposal-array-grouping/
- yashap 5y agoAh fair enough!
- saranshk 5y agoupdated the post with groupByToMap, Thanks for pointing that out.
- roebk 5y agoI wonder if groupBy should have had some sort of into argument. Otherwise, we may end up with four groupBy methods. groupBy, groupByToMap, groupByToWeakMap and groupByToRecord (should records land). Edit: this has already been discussed https://github.com/tc39/proposal-array-grouping/issues/3 https://github.com/tc39/proposal-array-grouping/issues/3