SOURCE

function curry(){
    let args = [].slice.call(arguments)

    return cc =  function(){
        args = [...args,...arguments]

        cc.toString =function(){
            return args.reduce((pre,item)=>{
                return pre + item
            },0)
        }
        return cc
    }
}


let sums = curry(1,2)(3)(4)


console.log(sums)


let add =(x,y)=>{
    add.toString =()=>{
        return x+y
    }

    return add
}



console.log(add(1,2).toString())
console 命令行工具 X clear

                    
>
console