🏠 Startseite
Vergleiche
📊 Alle Benchmarks 🦖 Dinosaurier v1 🦖 Dinosaurier v2 ✅ To-Do-Listen-Apps 🎨 Kreative freie Seiten 🎯 FSACB - Ultimatives Showcase 🌍 Übersetzungs-Benchmark
Modelle
🏆 Top 10 Modelle 🆓 Kostenlose Modelle 📋 Alle Modelle ⚙️ Kilo Code
Ressourcen
💬 Prompt-Bibliothek 📖 KI-Glossar 🔗 Nützliche 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]; }