Say I have a function called multiplyDivide
multiplyDivide
If I were to call multiplyDivide(2)(3)(4)(6) it would be equivalent to 2 * 3 / 4 * 6
multiplyDivide(2)(3)(4)(6)
2 * 3 / 4 * 6
function addValues(a, b) { if(b!=undefined) return a + b; return function(b) { return a + b; } } let output1 = addValues(2)(4); // 6 let output2 = addValues(2,1); // 3 console.log(output1); console.log(output2)