I'm trying to solve some javascript puzzle. I have some function (for example a function which calculates summa). But there is a weird calling of that function. example:
sum(5)
or sum(5,6) - should be 11
or sum(5)(6) - should be 11
or sum(1)(2)(3) - should be 6
Have never seen such function calling sum(1)(2)(3)(4).... Can you please explain or maybe put into documentation where this stuff is explained?
Thanks a lot.