Created
August 6, 2015 04:01
-
-
Save usmanity/497739e3c014af9c3ecd to your computer and use it in GitHub Desktop.
fibonacci sequence in javascript
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 fib(x){ | |
if (x == 0 || x == 1) { | |
return 1; | |
} else { | |
return fib(x-1) + fib(x-2); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment