Update sumAll-solution.js

This commit is contained in:
Will 2023-07-29 15:40:07 -05:00 committed by GitHub
parent 5513be576a
commit f5f6efae9b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -1,7 +1,7 @@
const sumAll = function (min, max) { const sumAll = function (min, max) {
if (!Number.isInteger(min) || !Number.isInteger(max)) return "ERROR"; if (!Number.isInteger(min) || !Number.isInteger(max)) return "ERROR";
if (min < 0 || max < 0) return "ERROR"; if (min < 0 || max < 0) return "ERROR";
if (min > max) { if (min > max) {
const temp = min; const temp = min;
min = max; min = max;
max = temp; max = temp;