passed all tests
This commit is contained in:
parent
a15eafb564
commit
8f82e0a685
|
@ -8,6 +8,15 @@ const sumAll = function(x, y) {
|
||||||
|
|
||||||
else if (Number.isInteger(x) == false || Number.isInteger(y) == false) {return('ERROR')}
|
else if (Number.isInteger(x) == false || Number.isInteger(y) == false) {return('ERROR')}
|
||||||
|
|
||||||
|
else if (x > y) {
|
||||||
|
let X = y;
|
||||||
|
let Y = x;
|
||||||
|
for (let i = X+1; i <=Y; i++) {
|
||||||
|
theSum = X += i
|
||||||
|
}
|
||||||
|
return theSum
|
||||||
|
}
|
||||||
|
|
||||||
else
|
else
|
||||||
|
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue