const [first, second, third, fourth] = groupByIndex( [1, 2, 100, 200], (num) => num.toString().length - 1);// first → [1, 2]// second → []// third → [100, 200]// fourth → undefined
Generated using TypeDoc
Example