Showing the basic usage pattern of a curry function.
We start off with this:
const a = [1,2,3,4];
console.log(a.map(x => x*2)); // [2, 4, 6, 8]
Here is the same thing using currying.
// Curry function
const mulby = y => x => x*y;
// New lambda partion
const mul2 = mulby(2);
// See how nice and hip the code reads.
console.log(a.map(mul2)); // [2, 4, 6, 8]