remove class based exercises

This commit is contained in:
Cody Loyd
2017-11-20 13:51:01 -06:00
parent f0bf584e59
commit 290e7f1da4
18 changed files with 67 additions and 164 deletions
+17 -2
View File
@@ -1,5 +1,20 @@
var sumAll = function() {
var sumAll = function(a, b) {
if (a > b) {
let temp = a
a = b
b = temp
}
if (
a < 0 || b < 0 ||
typeof a != 'number' || typeof b != 'number'
) {
return 'ERROR'
}
let sum = 0
for(let i = a; i < b + 1; i++) {
sum += i
}
return sum
}
module.exports = sumAll