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
Do you mean something like this?
var multiplyDivide = function(first){ return function(second){ return function(third){ return function(forth){ return first * second / third * forth; } } } } //should be 6 console.log(multiplyDivide(2)(4)(4)(3));