From 2457cb4099ed7313ce2cdf2e0b0e38716290937a Mon Sep 17 00:00:00 2001 From: liam robertson Date: Sat, 10 Oct 2020 19:06:51 +0100 Subject: [PATCH] sumAll solution: check if min/max are integers, not just numbers --- sumAll/sumAll.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sumAll/sumAll.js b/sumAll/sumAll.js index cb41f57..785abdb 100644 --- a/sumAll/sumAll.js +++ b/sumAll/sumAll.js @@ -1,5 +1,5 @@ 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 > max) { const temp = min;