Composes multiple functions from right to left.
The result of each function is passed as input to the previous function.
Functions to compose, applied from right to left.
A function that represents the composition of the input functions.
const add = (x: number) => x + 1;const double = (x: number) => x * 2;const composed = compose(double, add);console.log(composed(3)); // (3 + 1) * 2 = 8 Copy
const add = (x: number) => x + 1;const double = (x: number) => x * 2;const composed = compose(double, add);console.log(composed(3)); // (3 + 1) * 2 = 8
1.1.0
Composes multiple functions from right to left.
The result of each function is passed as input to the previous function.