Hi, I’ve been trying to get the second for loop to show up on console, so I can tell if it’s actually giving me the sum of the array. However, having tried both console.log and return, nothing happens. Any thoughts?
for (let i = array.length; i > 0; i–){
let newArr = array.filter(i => i % 2);
if(newArr > 9){
let difference = newArr - 9;
return difference;
} else {
return newArr;
};
//doesn't show up on console
let sum = 0;
for (let i = 0; i < array.length; i++) {
sum += array[i];