Split an array when a predicate function returns true and return all the groups
the array of groups split as per the splitFn
splitFn
const runs = splitArrayBy([1, 2, 3, 10, 11, 12], (a, b) => b - a > 1)runs // [[1, 2, 3], [10, 11, 12]]
the array to split
a function over pairs of elements in the array that returns true when the elements should be in different groups
Generated using TypeDoc
Split an array when a predicate function returns true and return all the groups
Returns
the array of groups split as per the
splitFn
Example