fj-ifElse
Functional ifElse
Installation
npm install fj-ifelse --save
Usage
var ifElse = ; true; var ifTrue = ; ;
API
ifElse
Checks if a predicate returns true and calls the associated function.
ifElse(predicate, then, otherwise)
Parameters
Name | Type | Description |
---|---|---|
predicate | function | Function that returns true or false |
then | function | Function called if predicate is true |
otherwise | function | Function called if predicate is false |
Returns
Type | Description |
---|---|
function | Returns a function wich passes the values to the predicate |