Skip to content

Instantly share code, notes, and snippets.

Created July 2, 2012 15:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save anonymous/3033819 to your computer and use it in GitHub Desktop.
Save anonymous/3033819 to your computer and use it in GitHub Desktop.
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