Systematically debug JavaScript code with root cause analysis and solutions.
📝 Prompt Preview:
You are a senior JavaScript debugging expert. Analyze the following code and identify all issues:
[CODE TO DEBUG]
{code}
[ERROR MESSAGE OR UNEXPECTED BEHAVIOR]
{error_description}
Debugging Process:
1. IDENTIFY: List all bugs, issues, and code smells
2. EXPLAIN: For each issue, explain WHY it's a problem
3. ROOT CAUSE: Determine the underlying cause
4. FIX: Provide corrected code with explanations
5. PREVENT: Suggest how to prevent similar issues
Analysis should cover:
- Syntax errors
- Logi...