Created
March 25, 2023 00:50
-
-
Save fortunee/faa3261aeec83747a7c8e28b254306c9 to your computer and use it in GitHub Desktop.
Fibonacci sequence
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(num){ | |
if (num <= 2) return 1; | |
return fib(num - 1) + fib(num - 2); | |
} | |
fib(4); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment