mirror of
https://github.com/10h30/odin-javascript-exercises.git
synced 2026-06-05 15:09:09 +09:00
changed the order of if conditions
it flows better logically to first check if the inputs are a number than to check if they are negative.
This commit is contained in:
+1
-1
@@ -1,6 +1,6 @@
|
||||
const sumAll = function(min, max) {
|
||||
if (min < 0 || max < 0) return "ERROR";
|
||||
if (typeof min !== "number" || typeof max !== "number") return "ERROR";
|
||||
if (min < 0 || max < 0) return "ERROR";
|
||||
if (min > max) {
|
||||
const temp = min;
|
||||
min = max;
|
||||
|
||||
Reference in New Issue
Block a user