Created
February 2, 2017 07:49
-
-
Save alexandr-kazakov/78a8ba9a65e76595a3181348147e47e4 to your computer and use it in GitHub Desktop.
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 pow(x,n) { | |
if (n != 1) { | |
return x *= pow(x,n - 1); | |
} else { | |
return x; | |
} | |
} | |
alert( pow(2,2,5)); // 8 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment