Difference to OOP:
o.f() vs. f(o)
AND:
apply parameters of a function in several calls
Goal: have unary functions
// A normal function with two arguments
const myFunction = (param1, param2) => { console.log(`I got called with ${param1} ${param2}` };
myFunction('Hello', 'World') // I got called with Hello World
// Now lets curry it
import {curry} from 'ramda';
const myCurriedFunction = curry(myFunction);
// does NOT execute the function, but stores the first arugment
const myCurriedHelloFunction = myCurriedFunction('Hello');
// ... do other things and then later
myCurriedHellFunction('World') // now prints 'I got called with Hello World');
_.forEach([1,2,3], (val) => console.log(val));
ramda.forEach((val) => console.log(val), [1,2,3]);
The price for all selected products should be calculated and displayed as followed:
If you want to learn more:
http://randycoulman.com/blog/categories/thinking-in-ramda/