🏠 Beranda
Benchmark
📊 Semua Benchmark 🦖 Dinosaurus v1 🦖 Dinosaurus v2 ✅ Aplikasi To-Do List 🎨 Halaman Bebas Kreatif 🎯 FSACB - Showcase Utama 🌍 Benchmark Terjemahan
Model
🏆 Top 10 Model 🆓 Model Gratis 📋 Semua Model ⚙️ Kilo Code
Sumber Daya
💬 Perpustakaan Prompt 📖 Glosarium AI 🔗 Tautan Berguna
Medium

Debug JavaScript Array Error

#debugging #javascript #problem-solving

Identify and fix a logic error in a provided JavaScript loop.

Identify the bug in the following JavaScript code and provide the corrected version. The code is intended to sum all numbers in an array but returns NaN: let arr = [1, 2, 3]; let sum = 0; for(let i=1; i<=arr.length; i++) { sum += arr[i]; }