UNPKG

@modern-kit/utils

Version:
18 lines (15 loc) 338 B
'use strict'; function groupBy(arr, iteratee) { const group = {}; for (let i = 0; i < arr.length; i++) { const item = arr[i]; const key = iteratee(item); if (group[key] == null) { group[key] = []; } group[key].push(item); } return group; } exports.groupBy = groupBy; //# sourceMappingURL=index.cjs.map