Return a function that is the composition of the functions
The returned function will take a variable number of arguments, apply the rightmost of
to the arguments, the next function in
fn1, ... (right-to-left) to the result, and so on.
fn1, ..., except the last, must take exactly one argument. The last function can take an arbitrary number of arguments.
compose is called with no arguments the
identity function is returned.
let negative_quotient = compose(sub, div) negative_quotient(8, 3) // -8/3 let s = compose(number_to_string, add)(10, 20, 8, 100) s // 138 is_string(s) // true
Core Module Index | Contents