Returns two separate arrays of everything that filter returns true,
and everything it returns false on. The in-built Array.filter() in
constrast only returns things that filter returns true for.
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. The in-built Array.filter() in constrast only returns things thatfilter
returns true for.