Created
November 30, 2017 16:07
-
-
Save AaronFlower/d32ec248f09c211edd34d2e42321be87 to your computer and use it in GitHub Desktop.
javascript currying
This file contains hidden or 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 add (a, b) { | |
return a + b | |
} | |
foo = [10, 20, 30, 40] | |
bar = foo.map(add.bind(null, 5)) | |
console.log(bar) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment