Groups all values in the iterable under the computed key, based on the keySelector.
keySelector
const map = groupBy([0, 1, 2, 10, 20, 100, 200], (num) => num.toString().charAt(0));// map → [// ['0', [0]],// ['1', [1, 10, 100]],// ['2', [2, 20, 200]],// ]
Generated using TypeDoc
Groups all values in the iterable under the computed key, based on the
keySelector
.Example