Understanding `Predicate.implies`: Ensuring Conditional Predicate Logic

Predicate.implies kinda weird, given a self predicate and that predicate, it produces a new predicate that given that a value matches self it must also match that to return true. Otherwise it returns true
const isTheWordEffect = Predicate.implies(
  Predicate.isString,
  Equals.equals("Effect")
)

isTheWordEffect("Effect") // true
isTheWordEffect("Sebastian") // false
isTheWordEffect(56) // true (?????????)

I'm obviously misunderstanding how its supposed to work, a few lines are very much needed to understand the utility
Was this page helpful?