I want to make this syntax possible:
var a = add(2)(3); //5
based on what I read at http://dmitry.baranovskiy.com/post/31797647
I\
Arrow functions undoubtedly make it pretty simple to get the required result:
const Sum = a => b => b ? Sum( a + b ) : a; console.log(Sum(3)(4)(2)(5)()); //14 console.log(Sum(3)(4)(1)()); //8