What is the outupt of the following snippet
function sum(a) {
var sum = a;
function f(b) {
sum += b;
return f;
}
f.toString = function() {
return sum;
}
return f;
}
console.log(sum(0)(1)(2)(3)(4)(5)); // 15
Answers:
- 012345
- 12345
- 1
- None of these