Skip to content

Instantly share code, notes, and snippets.

@tasseff
Last active May 23, 2022 06:38
Show Gist options
  • Select an option

  • Save tasseff/7208635 to your computer and use it in GitHub Desktop.

Select an option

Save tasseff/7208635 to your computer and use it in GitHub Desktop.
A recursive power function in Javascript.
function power(base, exponent) {
if (exponent == 0)
return 1;
else
return base * power(base, exponent - 1);
}
@Jasur0206
Copy link

great

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment