collectype / types/collection / PredicateFn
PredicateFn<
T> = (item) =>boolean
Defined in: types/collection.ts:27
Predicate function type for filtering collections.
T
The type of item in the collection.
T
The item to test.
boolean
True if the item should be included, false otherwise.
const isEven: PredicateFn<number> = n => n % 2 === 0;
[1,2,3,4].filter(isEven); // [2,4]