Completed the fifth exercise

This commit is contained in:
octopusGarden 2022-10-25 13:21:06 -04:00
parent 49743d45ee
commit 8800dd93ae
1 changed files with 7 additions and 1 deletions
05_sumAll

View File

@ -1,5 +1,11 @@
const sumAll = function() {
const sumAll = function(num1, num2) {
let sum = 0;
for (let i = num1; i <= num2; i++) {
sum += parseInt(i);
}
return sum;
};
// Do not edit below this line