Here is code blow to return it\'s value.
function sum(a){
return function(b){
return a+b;
}
}
sum(2)(3);
It returns 5 but
Your 'sum' function returns another function which returns a+b (2 parameters). Both functions together require two parameters: (a) and (b)
The inner most return, returns a+b. Plugging in your parameters, we get the equation: 2+3.
Which gives you 5.
Please let me know if you have any questions or concerns.