Created
July 2, 2012 15:35
-
-
Save anonymous/3033819 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 addThree(x) { | |
return x + 3; | |
} | |
function composed(func) { | |
return function(x) { | |
return func(func(x)) | |
} | |
} | |
composed(addThree)(4); | |
//I'm confused with a function with 2 parenthesis composed(addThree)(4). Is that only possible because (4) is an ANONYMOUS FUNCTION? any more documents about this type of function? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment