function sumAll(arr) {
// Step 1: Add all numbers greater than x (including x) and all numbers less than y (including y). Example [1,4] = [x,y] = 1 + 2 + 3 + 4 = 10 (Note: the lowest number is not always first)
return 1;
}
sumAll([1, 4]);

I wrote a step down of what I believe I have to do, but I am blanking out when it comes to thinking of what code to write to make it happen. Can someone please help me without giving me the answer?

function sumAll(arr) {
let sum = 0;
for(let i = Math.min.apply(null,arr); i <= Math.max.apply(null,arr); i += 1) {
sum += i;
}
return sum;
};
console.log(sumAll([1, 4]));