mirror of
https://github.com/10h30/odin-javascript-exercises.git
synced 2026-07-16 21:23:23 +09:00
Update sumAll-solution.js
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
const sumAll = function (min, max) {
|
const sumAll = function (min, max) {
|
||||||
if (!Number.isInteger(min) || !Number.isInteger(max)) return "ERROR";
|
if (!Number.isInteger(min) || !Number.isInteger(max)) return "ERROR";
|
||||||
if (min < 0 || max < 0) return "ERROR";
|
if (min < 0 || max < 0) return "ERROR";
|
||||||
if (min > max) {
|
if (min > max) {
|
||||||
const temp = min;
|
const temp = min;
|
||||||
min = max;
|
min = max;
|
||||||
max = temp;
|
max = temp;
|
||||||
|
|||||||
Reference in New Issue
Block a user