Update sumAll-solution.js

This commit is contained in:
cats256 2023-07-03 22:58:19 -05:00 committed by GitHub
parent 415ff48c20
commit 3ecdab9531
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -4,7 +4,7 @@ const sumAll = function (min, max) {
if (min > max) [min, max] = [max, min];
let sum = 0;
for (let i = min; i < max + 1; i++) {
for (let i = min; i <= max; i++) {
sum += i;
}
return sum;