when
Summary
Returns fn(...x) if pred(...x) has returned logical true. Otherwise returns undefined.
Tip
This function is curried.
Examples
1 2 3 4 5 | |
Parameters
| Name | Type | Description |
|---|---|---|
| pred | function |
Predicate. Must return logical true. |
| fn | function |
Function applied to the arguments if predicate is satisfied |
| x | ? |
One or more arguments |
Return
?