Merge pull request #82 from Musabii/patch-2

changed the order of if conditions
This commit is contained in:
Cody Loyd 2020-09-14 10:19:40 -05:00 committed by GitHub
commit 314a795e52
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,6 +1,6 @@
const sumAll = function(min, max) { const sumAll = function(min, max) {
if (min < 0 || max < 0) return "ERROR";
if (typeof min !== "number" || typeof max !== "number") return "ERROR"; if (typeof min !== "number" || typeof max !== "number") 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;