Sobes.tech
Junior — Senior

Sum of three numbers implemented through currying

livecode

Task condition

Create a function that takes three arguments sequentially (each call returns a new function expecting the next argument) and ultimately returns their sum. Example usage:

const add = (a) => (b) => (c) => a + b + c;
console.log(add(1)(2)(3)); // 6

The function should work for any numeric values passed through the chain of calls.

Sum of three numbers implemented through currying… - sobes.tech