Created
January 24, 2014 13:13
-
-
Save slopeofhope81/8596970 to your computer and use it in GitHub Desktop.
// Calculate and show the value of 2**10
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
// Calculate and show the value of 2**10 | |
var total = 1; | |
var i = 0; | |
var power = function (n) { | |
while (i < 10) { | |
total *= 2; | |
i++; | |
}; | |
return total; | |
}; | |
document.write(power(2)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment