diff --git a/05_sumAll/sumAll.js b/05_sumAll/sumAll.js index 00880c7..e733b01 100644 --- a/05_sumAll/sumAll.js +++ b/05_sumAll/sumAll.js @@ -1,5 +1,9 @@ -const sumAll = function() { - +const sumAll = function(a, b) { + let sum = 0; + for (let i = a; i <= b; i++) { + sum += i; + } + return sum; }; // Do not edit below this line diff --git a/05_sumAll/sumAll.spec.js b/05_sumAll/sumAll.spec.js index 1a9fb7c..e2f1c95 100644 --- a/05_sumAll/sumAll.spec.js +++ b/05_sumAll/sumAll.spec.js @@ -4,7 +4,7 @@ describe('sumAll', () => { test('sums numbers within the range', () => { expect(sumAll(1, 4)).toEqual(10); }); - test.skip('works with large numbers', () => { + test('works with large numbers', () => { expect(sumAll(1, 4000)).toEqual(8002000); }); test.skip('works with larger number first', () => {