diff --git a/guide/english/certifications/javascript-algorithms-and-data-structures/intermediate-algorithm-scripting/sum-all-odd-fibonacci-numbers/index.md b/guide/english/certifications/javascript-algorithms-and-data-structures/intermediate-algorithm-scripting/sum-all-odd-fibonacci-numbers/index.md index 1e57c13bd1..4463b97236 100644 --- a/guide/english/certifications/javascript-algorithms-and-data-structures/intermediate-algorithm-scripting/sum-all-odd-fibonacci-numbers/index.md +++ b/guide/english/certifications/javascript-algorithms-and-data-structures/intermediate-algorithm-scripting/sum-all-odd-fibonacci-numbers/index.md @@ -89,7 +89,8 @@ As you get the next odd one, don't forget to add it to a global variable that ca } // Sum only the odd numbers and return the value - return arrFib.reduce((acc, curr) => { + // First, reverse the array to avoid starting acc with the first/greater number when it's even + return arrFib.reverse().reduce((acc, curr) => { return acc + curr * (curr % 2); }); }