Hi I have a JavaScript problem:

"Sum odd numbers

Complete the function `sumOddNumbers`

such that it returns the sum of all the odd numbers from the `numbers`

parameter it receives.

The function should also work for negative numbers."

I tried:

function sumOddNumbers(numbers) {

let sum = 0;

numbers.forEach(function(number) { // array item (singular)

if (number % 2 === 1) {

sum = sum + number;

}

else if (number < 0) {

if (number % 2 === 1) {

sum = sum + number;

}

}

else {

console.log(“Positive/even number spotted.”);

}`}); return sum;`

}

I don’t understand why the negative odd numbers don’t add to the sum?

Edit: I fixed the problem. The problem is solved now.