Created
October 24, 2017 08:10
-
-
Save farskid/b3e36ff94fa22570adad2cee76737862 to your computer and use it in GitHub Desktop.
Calculate the exponential of an integer in Javascript
This file contains 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 expo(num, power) { | |
if (power === 1) return num; | |
return num * expo(num, power - 1); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment