Skip to content

Instantly share code, notes, and snippets.

@fortunee
Created March 25, 2023 00:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fortunee/faa3261aeec83747a7c8e28b254306c9 to your computer and use it in GitHub Desktop.
Save fortunee/faa3261aeec83747a7c8e28b254306c9 to your computer and use it in GitHub Desktop.
Fibonacci sequence
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