Skip to content

Instantly share code, notes, and snippets.

@lienista
Last active August 28, 2018 04:03
Show Gist options
  • Select an option

  • Save lienista/c4daf6b7308a9f8fe50c1ed73d0c2c7d to your computer and use it in GitHub Desktop.

Select an option

Save lienista/c4daf6b7308a9f8fe50c1ed73d0c2c7d to your computer and use it in GitHub Desktop.
const recursiveExponent = (base, exponent) => {
return exponent === 1? base: base*recursiveExponent(base, exponent-1);
}
const y = recursiveExponent(2,5);
console.log(y);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment