Created
November 24, 2014 17:42
-
-
Save mosdevly/ab993a34f5480abe8dde to your computer and use it in GitHub Desktop.
Write a function that returns the sum of numbers up to a max number given.
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
var sums = function(num) { | |
myNum = 0; | |
for (var i = 0; i <= num; i++) { | |
myNum += i; | |
} | |
console.log(myNum); | |
} | |
sums(3); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment