Created
January 30, 2022 14:05
-
-
Save gerep/5064a948f4e2faf50cd75ed198a0247f to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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