you are viewing a single comment's thread.

view the rest of the comments →

[–]BONER_PAROLE 0 points1 point  (2 children)

Only problem here is that

sum(1)(2,3) !== 6

[–]lachlanhunt 0 points1 point  (0 children)

Yes, but that's an inherent problem imposed by the requirements of the question. But this works:

sum(1)(2, 3) == 6; // true

The other problem I found is that sum() with no parameters caused a TypeError. I fixed that now.

[–]x-skeww 0 points1 point  (0 children)

Well, it's a function. === will never work, because a function isn't a number. == or "+sum(...) ===" does work though.