Created
May 20, 2018 16:10
-
-
Save RoseCrime/b57d648603434d011f2ee2d39f252ba3 to your computer and use it in GitHub Desktop.
function factory
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
const multiplier = factor => x => x * factor | |
let doubler = multiplier(2) | |
//doubler(4) = 8 | |
/* | |
function multiplier(factor) { | |
return function (x) { | |
return x * factor | |
} | |
} | |
*/ | |
//same thing |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment