mirror of
https://github.com/10h30/odin-javascript-exercises.git
synced 2026-07-13 03:36:07 +09:00
Clean up the oopsie. Rebuild the blank exercises.
This commit is contained in:
+3
-14
@@ -1,16 +1,5 @@
|
||||
const sumAll = function(min, max) {
|
||||
if (!Number.isInteger(min) || !Number.isInteger(max)) return "ERROR";
|
||||
if (min < 0 || max < 0) return "ERROR";
|
||||
if (min > max) {
|
||||
const temp = min;
|
||||
min = max;
|
||||
max = temp;
|
||||
}
|
||||
let sum = 0;
|
||||
for (let i = min; i < max + 1; i++) {
|
||||
sum += i;
|
||||
}
|
||||
return sum;
|
||||
};
|
||||
const sumAll = function() {
|
||||
|
||||
}
|
||||
|
||||
module.exports = sumAll;
|
||||
|
||||
Reference in New Issue
Block a user