Advanced
Debug Assistant
Identify logic errors and bugs in provided code.
📝 محتوى الأمر
Analyze the following JavaScript function. It is supposed to reverse a string, but it is returning the wrong output. Identify the bug, explain why it is happening, and provide the corrected code. [Insert code here]