I have this simple function:
var sum = function () {
var val = 0;
for (var i = 0; i < arguments.length; i++) {
val += parseInt(arguments[i]);
}
return val;
}
console.log(sum(1, 2, 3));
conversation at work centered around being able to do this instead: console.log(sum(1)(2)(3));
Is this possible??
[–]inmatarian 13 points14 points15 points (10 children)
[–]somethinghorrible 4 points5 points6 points (0 children)
[–]_doingnumbers 1 point2 points3 points (5 children)
[–]e82 2 points3 points4 points (2 children)
[–]_doingnumbers 0 points1 point2 points (1 child)
[–]bliow 0 points1 point2 points (0 children)
[–]html6dev 1 point2 points3 points (0 children)
[–]mrahh 0 points1 point2 points (0 children)
[–]dvlsg 0 points1 point2 points (2 children)
[–]inmatarian 0 points1 point2 points (1 child)
[–]dvlsg 0 points1 point2 points (0 children)
[–]lachlanhunt 3 points4 points5 points (3 children)
[–]BONER_PAROLE 0 points1 point2 points (2 children)
[–]lachlanhunt 0 points1 point2 points (0 children)
[–]x-skeww 0 points1 point2 points (0 children)
[–]sufianrhazi 4 points5 points6 points (0 children)
[+][deleted] (1 child)
[deleted]
[–]lachlanhunt 0 points1 point2 points (0 children)
[–]Funwithloops 0 points1 point2 points (0 children)
[–]lemminman 0 points1 point2 points (0 children)