Last active
January 18, 2017 20:30
-
-
Save ityonemo/d143da2078c3b5d51536c974629940c1 to your computer and use it in GitHub Desktop.
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 magicsum(arg){ | |
var sumsofar = 0; | |
var f; | |
f = function(inner_arg){ | |
if (inner_arg){ | |
sumsofar += inner_arg; | |
return f; | |
} else { | |
return sumsofar; | |
} | |
} | |
return f(arg) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment