From f9a972ec167c65fea7d3ad6464c58904f7547bc4 Mon Sep 17 00:00:00 2001
From: Musabii <60546157+Musabii@users.noreply.github.com>
Date: Thu, 25 Jun 2020 11:58:02 +0200
Subject: [PATCH] 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.
---
 sumAll/sumAll.js | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sumAll/sumAll.js b/sumAll/sumAll.js
index 1429afa..cb41f57 100644
--- a/sumAll/sumAll.js
+++ b/sumAll/sumAll.js
@@ -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;