Currying in Javascript means use of function expression with new function. We can see function expression could be Closure.
–JS File
var add = function(a){ return function(b){ return a + b; } }; var addToFive = add(5); console.log(addToFive(1));
–Live Demo
[codepen_embed height=”265″ theme_id=”0″ slug_hash=”rZvyZM” default_tab=”js,result” user=”pradeepanvi”]See the Pen Currying in Javascript by Pradeep Kumar (@pradeepanvi) on CodePen.[/codepen_embed]