Last active
September 10, 2019 19:22
-
-
Save fonzerelly/7779253 to your computer and use it in GitHub Desktop.
simple example for the usage of lodash.js _.partial
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
var add = function (a, b) { | |
return a + b; | |
}; | |
var add5 = _.partial(add, 5); | |
add(3,4); | |
// 7 | |
add5(3); | |
// 8 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment