Skip to content

Instantly share code, notes, and snippets.

@javarouka
Last active March 27, 2019 07:44
Show Gist options
  • Save javarouka/ffa4961cf3cd7be394919b1d4aeeb728 to your computer and use it in GitHub Desktop.
Save javarouka/ffa4961cf3cd7be394919b1d4aeeb728 to your computer and use it in GitHub Desktop.
function forFn(n) {
if(n === 0) return 1;
var a = 1;
for(var i = 0; i<n; i++) a = a * 2
return a
}
function recursiveFn(n, m) {
if(!m) return factRecursive(n, 1)
if(n === 0) return m;
return recursiveFn(n-1, m * 2);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment