function sumAll(arr) {
arr.sort();
let lum = [];
for (let i = arr[1]; i > arr[0]; i--) {
lum.push(arr[i]);
}
return lum;
}
console.log(sumAll([1, 4]));
I want my code to do 4-3, then add the result to lum and so on until it reaches 1 but i'm stuck at this point. I don't know why it returns undefined.