Advanced
Code Debugging Assistant
Identify potential bugs or logic errors in a provided code snippet.
📝 Treść promptu
Here is a JavaScript function intended to reverse a string. It is not working as expected. Can you identify the bug and provide the corrected code? function reverseString(str) { return str.split('').reverse().join(''); } Wait, the input is null and it crashes. How do I fix this edge case?