8000 sumAll solution: check if min/max are integers, not just numbers · GeraldCO/javascript-exercises@2457cb4 · GitHub
[go: up one dir, main page]

Skip to content

Commit 2457cb4

Browse files
authored
sumAll solution: check if min/max are integers, not just numbers
1 parent 314a795 commit 2457cb4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

sumAll/sumAll.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
const sumAll = function(min, max) {
2-
if (typeof min !== "number" || typeof max !== "number") return "ERROR";
2+
if (!Number.isInteger(min) || !Number.isInteger(max)) return "ERROR";
33
if (min < 0 || max < 0) return "ERROR";
44
if (min > max) {
55
const temp = min;

0 commit comments

Comments
 (0)
0