Skip to content

Instantly share code, notes, and snippets.

@sergiors
Last active August 29, 2015 14:21
Show Gist options
  • Save sergiors/726970cb3a7beb96d7d2 to your computer and use it in GitHub Desktop.
Save sergiors/726970cb3a7beb96d7d2 to your computer and use it in GitHub Desktop.
// before
var fib = function(n) {
if (n <= 1) {
return n;
}
else {
return fib(n - 1) + fib(n - 1);
}
};
// after
var fib = function(n) {
if (n <= 1) {
return n;
}
return fib(n - 1) + fib(n - 1);
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment