Skip to content

Instantly share code, notes, and snippets.

@gerep
Created January 30, 2022 14:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gerep/5064a948f4e2faf50cd75ed198a0247f to your computer and use it in GitHub Desktop.
Save gerep/5064a948f4e2faf50cd75ed198a0247f to your computer and use it in GitHub Desktop.
function pow(n, m){
if (m === 1) {
return n
}
return n * pow(n, m - 1)
}
console.log(pow(2,2))
console.log(pow(2,3))
console.log(pow(3,3))
console.log(pow(10,4))
console.log(pow(67, 5))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment