Created
December 28, 2019 04:39
-
-
Save bhaveshdaswani93/288a0830210ac84ab109c0359c5b133c to your computer and use it in GitHub Desktop.
Currying in javascript
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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