🏠 Trang chủ
Benchmark
📊 Tất cả benchmark 🦖 Khủng long v1 🦖 Khủng long v2 ✅ Ứng dụng To-Do List 🎨 Trang tự do sáng tạo 🎯 FSACB - Trình diễn cuối cùng 🌍 Benchmark dịch thuật
Mô hình
🏆 Top 10 mô hình 🆓 Mô hình miễn phí 📋 Tất cả mô hình ⚙️ Kilo Code
Tài nguyên
💬 Thư viện prompt 📖 Thuật ngữ AI 🔗 Liên kết hữu ích
advanced

Identify and Fix Code Bug

#debugging #javascript #problem-solving

Analyze a JavaScript snippet to find syntax or logical errors.

Analyze the following JavaScript code snippet intended to filter out even numbers from an array. Identify why it is not working as expected, explain the error, and provide the corrected code. Code: const nums = [1, 2, 3, 4, 5]; const evens = nums.filter(x => x % 2 == 1);