Created
December 17, 2015 16:19
-
-
Save Nata01/871ab58e048350291215 to your computer and use it in GitHub Desktop.
Summarizing using loop.
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 sumTo(n){ | |
rez = 0; | |
for(var i = 0; i <= n; i++){ | |
rez += i; | |
} | |
return rez; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment