【文件属性】:
文件名称:js代码-function add(x) {
return x + 10
}
function multiply(x) {
return x * 10
}
function compose(f,g) {
return function(x) {
return f(g(x));
};
}
// 这样我们我们可以通过如下的方式得到合成函数
// 执行动作的顺序是从右往左
let calculate=compose(multiply,
文件大小:958B
文件格式:ZIP
更新时间:2021-07-14 21:15:42
代码
js代码-function add(x) {
return x + 10
}
function multiply(x) {
return x * 10
}
function compose(f,g) {
return function(x) {
return f(g(x));
};
}
// 这样我们我们可以通过如下的方式得到合成函数
// 执行动作的顺序是从右往左
let calculate=compose(multiply,add);
console.log(calculate(2)) // 120
【文件预览】:
main.js
README.txt