Created
April 12, 2017 05:30
-
-
Save anonymous/813cbb4b2862242d323880732c900d46 to your computer and use it in GitHub Desktop.
6.1 Exponentiate created by smillaraaq - https://repl.it/HGCJ/1
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 exponentiate(num1, num2){ | |
var output=1; | |
for(var i=0;i<num2;i++){ | |
output*=num1;console.log(i," ",output); | |
} | |
return output; | |
} | |
exponentiate(2, 2) // => 4 | |
//exponentiate(3, 4) // => 81 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment