In case you missed it, JavaScript finally implemented
a groupBy static method for Object and Map
On Monday, 21 August 2023 at 20:42:18 UTC+2, Michael Haufe (TNO) wrote:
In case you missed it, JavaScript finally implementedYou might have missed that it's neither decently supported,
a groupBy static method for Object and Map
nor, as for the enthusiasm, it has anything to do with the
aggregation operator by the same name, in fact, with any
aggregation at all: this "groupBy" is more of a "partitionBy"
and can be implemented in one line of code with an array
reduce over the input's keys. Indeed, I'd call it plain clutter.
Julio
On Monday, 21 August 2023 at 20:42:18 UTC+2, Michael Haufe (TNO) wrote:
In case you missed it, JavaScript finally implementedYou might have missed that it's neither decently supported,
a groupBy static method for Object and Map
nor, as for the enthusiasm, it has anything to do with the
aggregation operator by the same name, in fact, with any
aggregation at all: this "groupBy" is more of a "partitionBy"
and can be implemented in one line of code with an array
reduce over the input's keys. Indeed, I'd call it plain clutter.
On Saturday, September 2, 2023 at 4:50:21 AM UTC-5, Julio Di Egidio wrote:
On Monday, 21 August 2023 at 20:42:18 UTC+2, Michael Haufe (TNO) wrote:
In case you missed it, JavaScript finally implemented
a groupBy static method for Object and Map
You might have missed that it's neither decently supported,
In case you missed it, I provided availability statistics in my
post plus the babel plugin.
nor, as for the enthusiasm, it has anything to do with the
aggregation operator by the same name, in fact, with any
aggregation at all: this "groupBy" is more of a "partitionBy"
and can be implemented in one line of code with an array
reduce over the input's keys. Indeed, I'd call it plain clutter.
Given the Universality and Expressiveness of Fold [1], we can
say that about most functions/methods
In case you missed it, JavaScript finally implemented a groupBy static method for Object and Map:
Map.groupBy(iterable, callbackFn)
Object.groupBy(iterable, callbackFn)
On Monday, 21 August 2023 at 20:42:18 UTC+2, Michael Haufe (TNO) wrote:
In case you missed it, JavaScript finally implemented
a groupBy static method for Object and Map
You might have missed that it's neither decently supported,
nor, as for the enthusiasm, it has anything to do with the
aggregation operator by the same name, in fact, with any
aggregation at all: this "groupBy" is more of a "partitionBy"
and can be implemented in one line of code with an array
reduce over the input's keys. Indeed, I'd call it plain clutter.
Julio
Michael Haufe (TNO), 2023-08-21 20:42:
In case you missed it, JavaScript finally implemented a groupBy static method for Object and Map:
Map.groupBy(iterable, callbackFn)Which is not widely supported yet:
Object.groupBy(iterable, callbackFn)
<https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/groupBy#browser_compatibility>
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 457 |
Nodes: | 16 (2 / 14) |
Uptime: | 131:45:17 |
Calls: | 9,337 |
Calls today: | 8 |
Files: | 13,534 |
Messages: | 6,082,291 |
Posted today: | 1 |