Skip to content

Instantly share code, notes, and snippets.

@bhaveshdaswani93
Created December 28, 2019 04:39
Show Gist options
  • Save bhaveshdaswani93/288a0830210ac84ab109c0359c5b133c to your computer and use it in GitHub Desktop.
Save bhaveshdaswani93/288a0830210ac84ab109c0359c5b133c to your computer and use it in GitHub Desktop.
Currying in javascript
const multiply = (a,b) => a*b;
multiply(4,6) // 24
//above is the function that take multiple argument let convert into curring
const curring = (a)=>(b)=>a*b;
curring(5)(4); // 20
// we have converted multiply function that take 2 param
// into two function that takes one parameter at a time
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment