compose multiple functions, right to left
组合多个函数,从右到左执行
The functions to compose. 要组合的函数
A new function that is the composition of the input functions. 由输入函数组合而成的新函数
const add = (a) => a + 1const subtract = (a) => a - 2const multiply = (a, b) => a * bcompose(add, subtract, multiply)(1, 2) // => (1 * 2) - 2 + 1 = 1 Copy
const add = (a) => a + 1const subtract = (a) => a - 2const multiply = (a, b) => a * bcompose(add, subtract, multiply)(1, 2) // => (1 * 2) - 2 + 1 = 1
compose multiple functions, right to left
组合多个函数,从右到左执行