sumAll solution: check if min/max are integers, not just numbers
This commit is contained in:
parent
314a795e52
commit
2457cb4099
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue