Last active
January 1, 2016 23:55
-
-
Save mehrdadrafiee/d32fc0aff929d7ef4066 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
for (var i=1; i<10; i++) { | |
var randomNum = Math.floor(Math.random() * (10 - 0 + 1)) + 0; | |
var power = function (base, exponent) { | |
var result = 1; | |
for (var count=0; count<exponent; count++) { | |
result *= base; | |
} | |
return result; | |
} | |
console.log(power(randomNum, randomNum)); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment