Merge pull request #113 from mangonaise/patch-1

sumAll solution: check if min/max are integers, not just numbers
This commit is contained in:
Briggs Elsperger 2020-10-12 10:38:12 -05:00 committed by GitHub
commit 8eeb98ee71
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,5 +1,5 @@
const sumAll = function(min, max) { const sumAll = function(min, max) {
if (typeof min !== "number" || typeof max !== "number") 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;