Created
May 9, 2020 16:14
-
-
Save iamamit-107/c51ba861134cc4c2c3f734e689adb42d to your computer and use it in GitHub Desktop.
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
function fib(n) { | |
if (n < 2) { | |
return n; | |
} | |
return fib(n - 1) + fib(n - 2); | |
} | |
console.log(fib(6)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment