Created
March 20, 2017 03:19
-
-
Save ltfschoen/5511077b6924cc2c41463ddbc910eb22 to your computer and use it in GitHub Desktop.
Lexically nested functions within enclosing function
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
// Lexically nested function definitions defined within enclosing function | |
function Sum(arg0) { | |
function Inner1(arg1) { | |
function Inner2(arg2) { | |
return arg0 + arg1 + arg2; | |
} | |
return Inner2; | |
} | |
return Inner1; | |
} | |
console.log(Sum(3)(4)(5)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment