Arity & Currying
This is a series of blogs where I collect some interesting programming concepts, new things I learn Arity represents the number of arguments we pass to a function (or module). Say you may pass N args to a function. Currying is the process of reducing the number of arguments you pass to 1 but increase the number of functions to N. For Eg. To add three variables a, b and c you may write func like below function add (a,b,c){ return a+b+c; } add (45, 46, 47); Currying the same above function is then like below function add (a){ return function add (b){ return function add (c){ return a+b+c; }; }; } add (45) (46) (47); Notice how each function returns another function until the last function does the final…