Last active
August 3, 2016 05:27
-
-
Save kshimi/eb74f7c26c2d16762560 to your computer and use it in GitHub Desktop.
JavaScriptによるフィボナッチ数列再帰版
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
// fibonacci number | |
alert( | |
(function(n) // nameless function 1 | |
{ // nameless function1 body | |
return "1," + (f = function(a, b, n) // nameless function 2 | |
{ // nameless function2 body | |
if (n == 0 ) | |
{ | |
return ""; | |
} | |
return a + "," + f(a+b, a, n-1); | |
} | |
) (1, 1, n); // inline function call 2 | |
} | |
) (100) // inline function call 1 | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment