SOURCE

const funcs = [
    (param) => {
        console.log("1")
        console.log("param + 1:  " + (param + 3))
        return param + 1
    },
    (param) => {
        console.log("2")
        console.log("param + 2:  " + (param + 2))
        return param + 2

    },
    (param) => {
        console.log("3")
        console.log("param + 3:  " + (param + 3))
        return param + 3
    },
]
const result = funcs.reduce((a, b) => (...args) => a(b(...args)))
console.log(result(1))
console 命令行工具 X clear

                    
>
console