when
Returns a function that takes one argument and runs a callback if it's truthy or returns it if falsy.
- Return a function expecting a single value,
x
, that returns the appropriate value based onpred
.
Returns a function that takes one argument and runs a callback if it's truthy or returns it if falsy.
x
, that returns the appropriate value based on pred
.