Created
March 29, 2016 10:29
-
-
Save sophiabrandt/72c78b9aa87236f4c086 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 sumAll(arr) { | |
var max = Math.max(arr[0], arr[1]); | |
var min = Math.min(arr[0], arr[1]); | |
var temp = 0; | |
for (var i=min; i <= max; i++){ | |
temp += i; | |
} | |
return(temp); | |
} | |
sumAll([1, 4]); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment