Array Length Quiz
Multiple Choice Beginner
Question
What is the length of `[1, 2, 3, 4, 5]`?
Hint
Count the elements: 1, 2, 3, 4, 5.
Explanation
The length of an array is the number of elements it contains. The array [1, 2, 3, 4, 5] has 5 elements, so its length is 5. The last valid index is length - 1 = 4.
Related Resources
Related Lessons
- Arrays
Learn how arrays store ordered lists of values.
Look up unfamiliar terms
A beginner-friendly glossary explains jargon in plain English — variables, functions, DOM, Promise, and more.
Decode error messages
Plain-English explanations of common errors — what they mean, why they happen, and how to fix them.
Build real projects
Apply what you learned by building guided projects with starter code and solutions.