Arrays in JavaScript

Number MethodsArray Methods

Arrays are like shopping lists or to-do lists in JavaScript. They keep things in order, and you can put anything in them: words, numbers, even other lists!

Every item in an array has a position number, starting from 0 (yes, computers count from 0!). Let's learn step by step with simple examples you can try right now.

How to Create an Array

Just put things inside square brackets [] and separate them with commas.

See? The console shows the whole list! 🎉

Getting Items from an Array

Use the position number (called index) inside square brackets. Remember: first item is 0!

Changing Items in an Array

Arrays are flexible – you can change any item whenever you want!

How Many Items? – The length Property

Every array knows how many items it has – just ask with .length!

Arrays Inside Arrays (Nested)

You can even put arrays inside arrays – like a grid!

Quick Fun Quiz

We have reviewed and checked the materials, but errors may still occur. The content is provided for educational purposes only, so use it at your own responsibility and verify with other sources if needed.

✨ Ask Lara — your AI study partner

Unlock personalized learning support. Lara can explain lessons, summarize topics, and answer your study questions — available from the Go plan and above.


Lara helps you learn faster — exclusive to ReadyTools Go, Plus, and Max members.

Track Your Progress 🚀

Learn more easily by tracking your progress completely for free.