Returns the result of fn(x) when the predicate is true, or x when the predicate is false.
fn(x)
x
when(isOdd)(add(2))(3)// => 5when(isOdd)(add(2))(4)// => 4 Copy
when(isOdd)(add(2))(3)// => 5when(isOdd)(add(2))(4)// => 4
Generated using TypeDoc
Returns the result of
fn(x)
when the predicate is true, orx
when the predicate is false.