function happy() { var sum = 0 console.log(arguments) var a = arguments.length for (var i = 0; i < a; i++) { sum += arguments[i] } var kksk = function () { console.log(arguments) if (arguments.length == 0) { console.log(sum) } else { var a = arguments.length for (var i = 0; i < a; i++) { sum += arguments[i] } console.log(sum) } return kksk; } return kksk } happy(1, 2, 3)(1,2)(1,2,3)(1,2,3,4,5,6,7)