-
-
Save haltcase/b499a4dea44a49bdb27770a146caa280 to your computer and use it in GitHub Desktop.
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
function sumOfThreeNumbers (x, y, z) { | |
return x + y + z | |
} | |
// roughly equivalent ways to do the same thing: | |
const sumPlusTwo = sumOfThreeNumbers.bind(null, 2) | |
const sumPlusTwo = _.partial(sumOfThreeNumbers, 2) // using lodash | |
const sumPlusTwo = (y, z) => sumOfThreeNumbers(2, y, z) | |
sumPlusTwo(4, 4) | |
// -> 10 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment