Hard
Debugging Assistant
Identify and fix logic errors in provided code.
📝 প্রম্পট বিষয়বস্তু
Analyze the following JavaScript function. Identify the logical error preventing it from calculating the correct sum of an array of numbers. Provide the corrected code and a brief explanation of the fix.