.groupBy was added. https://biga-ahk.github.io/biga.ahk/#/?id=groupby
Creates an object composed of keys generated from the results of running each element of collection thru iteratee.
Code: Select all
A.groupBy([6.1, 4.2, 6.2], A.floor)
; => {4: [4.2], 6: [6.1, 6.2]}
A.groupBy([6.1, 4.2, 6.3], func("Ceil"))
; => {5: [4.2], 7: [6.1, 6.3]}
users := [ { "user": "barney", "lastActive": "Monday" }
, { "user": "fred", "lastActive": "Tuesday" }
, { "user": "pebbles", "lastActive": "Tuesday" } ]
; The `A.property` iteratee shorthand.
A.groupBy(users, "lastActive")
/* => {"Monday": [{ "user": "barney", "lastActive": "Monday" }]
, "Tuesday": [{ "user": "fred", "lastActive": "Tuesday" }, { "user": "pebbles", "lastActive": "Tuesday" }]}*/