×

Welcome to TagMyCode

Please login or create account to add a snippet.
0
0
 
0
Language: Javascript
Posted by: edo64
Added: Jul 30, 2017 7:43 PM
Views: 6
Tags: javascript
  1. function fib(n) {
  2.   if (n < 2) {
  3.     return n;
  4.   } else {
  5.     return fib(n - 1) + fib(n - 2);
  6.   }
  7. }
  8. console.log("Fib(9) = " + fib(9));