adkt
5/18/2018 - 4:48 AM

Currying

A function that instead of taking all arguments at one time, takes them one at a time as indivdual anonoymous functions.

const sum = x => y => x + y;

sum (2)(1);     //3

//Currying/Chaining explained
const sum = x => y => x + y;

//Translation in es5
var sum = function(x){
    return function(y){
        return x + y;
    };
};