Andrew's Digital Garden

What is a predicate?

A predicate is a function, that when given input, returns a boolean as an answer.

Predicates are often found in the form of callbacks (e.g. filter in JS). However it's also used to describe any function that returns a bool, such as an if statement.

[[concepts]]

What is a predicate?