Advertisement
DPOH-VAR

Recursive RLY

Jun 23rd, 2017
137
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function f(x){
  2.     if (x <= 2) return x;
  3.     return f(x-2) + f(x-1);
  4. }
  5.  
  6. console.log( f(8) );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement