SOURCE

function sum(x) {
    var result = x;
    return function _sum(y) {
        result += y;
        console.log(result);
        return _sum;
    }

    this.valueOf = function () {
        console.log('valueOf');
    }

    this.toString = function () {
        console.log('toString');
    }


}

console.log(sum(1)(1))
console 命令行工具 X clear

                    
>
console