Predicate<Input, Predicated>:Unary<Input, boolean> | ((input) => input is Predicated)
Unary function that returns a boolean.
Remarks
This type is useful for cases where a function needs to check if a certain
condition holds for an input value. For example, the type of a function that
checks if a number is even could be typed as Predicate<number>, a filtering
function could look like Predicate<string | number, string>, and so on.
Unary function that returns a
boolean
.Remarks
This type is useful for cases where a function needs to check if a certain condition holds for an input value. For example, the type of a function that checks if a number is even could be typed as
Predicate<number>
, a filtering function could look likePredicate<string | number, string>
, and so on.Example
See
Param
The input value to check.
Returns
true
if the predicate holds for the input value, andfalse
otherwise.