Currying - JavaScript
//English <!-- What is currying? --> Currying is when you break a complex function into a serie of functions. It means that if you have a function that takes 2 arguments, you can break it into 2, each one will receive one parameter, something like this: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 //Complex Function function greetingsComplex(msg,name){ console.log(msg + ', ' + name); } //Simple Function function greetingsEasy(msg){ return function (name){ console.log(msg + ', ' + name); } } greetingsComplex( 'Hello' , 'Carlos' ); greetingsComplex( 'Hello' , 'Ulises' ); greetingsComplex( 'Hello' , 'Hector' ); var greetings = greetingsEasy( 'Hello' ); greetings( 'Carlos' ); greetings( 'Ulises' ); greetings( 'Hector' ); As you can see above, it's easier to understand the easiest way t...