Skip to content

Instantly share code, notes, and snippets.

@gerep
Created Jan 30, 2022
Embed
What would you like to do?
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