Skip to content

Instantly share code, notes, and snippets.

@AntonisFK
Created April 6, 2016 23:49
Show Gist options
  • Save AntonisFK/5e255f0a1869078ebce9549df2eab314 to your computer and use it in GitHub Desktop.
Save AntonisFK/5e255f0a1869078ebce9549df2eab314 to your computer and use it in GitHub Desktop.
recursive Fibonacci sequence
var rFibonacci = function(num){
if(num === 1 || num ===2 ){
return 1;
}else {
return rFibonacci(num-1) + rFibonacci(num-2);
}
};
rFibonacci(6);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment