Arrays in JavaScript

Zahlen-MethodenArray-Methoden

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

Wir haben die Materialien überprüft, dennoch können Fehler vorkommen. Der Inhalt dient ausschließlich Bildungszwecken, daher verwende ihn auf eigene Verantwortung und überprüfe ihn bei Bedarf mit anderen Quellen.

✨ Frag Lara — deine KI-Lernpartnerin

Entsperre personalisierte Lernunterstützung. Lara kann Lektionen erklären, Themen zusammenfassen und deine Lernfragen beantworten — verfügbar ab dem Go-Tarif.


Lara hilft dir, schneller zu lernen — exklusiv für ReadyTools Go-, Plus- und Max-Mitglieder.

Verfolge deinen Fortschritt 🚀

Lerne einfacher, indem du deinen Fortschritt kostenlos verfolgst.