Returns two separate arrays of everything that filter returns true,
and everything it returns false on.
Same idea as the in-built Array.filter, but that only returns values for one case.
const [ matching, nonMatching ] = filterAB(data, v=>v.enabled); // `matching` is a list of items from `data` where .enabled is true // `nonMatching` is a list of items from `data` where .enabled is false
Returns two separate arrays of everything that
filter
returns true, and everything it returns false on.Same idea as the in-built Array.filter, but that only returns values for one case.