Arrays in JavaScript
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
Hemos revisado y comprobado los materiales, pero aún pueden existir errores. El contenido se ofrece únicamente con fines educativos, así que úsalo bajo tu propia responsabilidad y verifica con otras fuentes si es necesario.
✨ Pregunta a Lara — tu compañera de estudio con IA
Desbloquea soporte de aprendizaje personalizado. Lara puede explicar lecciones, resumir temas y responder tus preguntas — disponible desde el plan Go y superiores.
Lara te ayuda a aprender más rápido — exclusivo para los miembros ReadyTools Go, Plus y Max.


