Hard
JavaScript Logic Debugging
Identify and fix a logical error in a JavaScript array manipulation function.
📝 Nội dung Prompt
I have a JavaScript function intended to filter out all odd numbers from an array and return the sum of the remaining even numbers. However, it is currently returning NaN. Identify the logical error in the code, explain why it is causing the issue, and provide the corrected code snippet that handles empty arrays or arrays with no even numbers correctly.