1// Curring Adding two items
2const sum = x => y => x + y
3sum(2)(2)//4
4// Adding three or more items
5const sum = x => (y=0) => (...z) => +x + +y + +z.reduce((prev,curr)=>prev+curr,0)
6sum(2)()()//2
7sum(2)(2)()//4
8sum(2)(2)(2)//6
9sum(2)(2)(2)(2)//8