js 管道
function fun1(ss) { console.log(ss + "1") return 'b' } function fun11(ss) { console.log(ss + "11") return 'ab' } function fun12(ss) { console.log(ss + "12") return 'abc' } const funpipe = function () { const args = Array.from(arguments) //console.log(args) return function (val) { //console.log(val) for (let i = 0; i < args.length; i++) { const fun = args[i] val = fun(val) } return val } } funpipe(fun1, fun11, fun12)("aa")
aa1
b11
ab12