functional programing explained with JavaScript. composition, closure, currying, etc. 2019-09-08

functional programing explained with JavaScript. composition, closure, currying, etc. 2019-09-08

topics covered:

// currying in JavaScript

// this is a function that takes 2 args
const ff = ((x,y) => x+y);

console.log ( ff(3,4) === 7 );

const f1 = ((f) => ((y) => f(y)));
const f2 = ((x) => ((y) => y+x) );

let x = 3;
let y = 9917;

console.log ( f1(f2(x))(y) === ff(x,y) );

If you have a question, put $5 at patreon and message me.