🏠 Home
Benchmark Hub
📊 All Benchmarks 🦖 Dinosaur v1 🦖 Dinosaur v2 ✅ To-Do List Applications 🎨 Creative Free Pages 🎯 FSACB - Ultimate Showcase 🌍 Translation Benchmark
Models
🏆 Top 10 Models 🆓 Free Models 📋 All Models ⚙️ Kilo Code
Resources
💬 Prompts Library 📖 AI Glossary 🔗 Useful Links
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]; }