What Is an Array?
An array holds many values in order.
What Is an Array? is a free Javascript for Kids lesson on CoddyKit — lesson 1 of 4. You can read the complete lesson below for free — then practise it hands-on in the browser with a built-in code editor and a 24/7 AI tutor. It is part of the Javascript for Kids learning path, one of 4 lessons in the course, and your progress syncs across the web and the CoddyKit app.
Treasure Lists! 🗃️
Hi, treasure hunter! 🌟 What if we want to hold MANY things in one box?
We use an array — a special list that holds lots of values! 💎
let treasure = ["gold", "gem", "crown"]
console.log(treasure)A List in Brackets 📋
An array uses square brackets [ ] with values inside, split by commas.
["cat", "dog", "fish"] is a list of 3 pets! 🐱🐶🐟
let pets = ["cat", "dog", "fish"]
console.log(pets)Lists of Numbers 🔢
Arrays can hold numbers too!
[1, 2, 3] is a list of three numbers. So neat. 🧮
let numbers = [1, 2, 3, 4, 5]
console.log(numbers)Saving a List in a Box 📦
We save an array in a box with a name, just like before!
Here we save a list of fruits. 🍎🍌🍇
let fruits = ["apple", "banana", "grape"]
console.log(fruits)How Many Items? 🔢
We can count items with .length, just like strings!
How many treasures are in our list? 💎
let treasure = ["gold", "gem", "crown"]
console.log(treasure.length)Lists of Anything 🌈
Arrays can hold colors, names, numbers, anything!
Let us make a rainbow list. 🌈
let colors = ["red", "blue", "green"]
console.log(colors)A Shopping List 🛒
Arrays are like real lists! A shopping list holds many things.
Let us go shopping. 🛍️
let shopping = ["milk", "bread", "eggs"]
console.log("Need to buy:", shopping)An Empty List 🫙
An array with nothing inside is an empty list: []
We can add things to it later! 📥
let basket = []
console.log(basket)
console.log("Items:", basket.length)A Team of Friends 🧒
Let us make a list of our team!
Everyone in one happy list. 🤝
let team = ["Sam", "Lily", "Max", "Zoe"]
console.log("My team:", team)Mixing It Up 🎲
An array can even hold different kinds of things at once!
Words and numbers together. 🔤🔢
let mix = ["star", 5, "moon", 10]
console.log(mix)Your Treasure List 🧒
Make YOUR own treasure list! Change the items to your favorites.
What treasures will you collect? 💎
let myTreasure = ["sword", "shield", "map"]
console.log(myTreasure)Quick Check ✅
Treasure question! You can find it! 🗺️
Treasure Hunter! 🏆
Fantastic! 🎉 Today you learned:
- An array holds many values
- It uses square brackets
[ ] .lengthcounts the items
You are a treasure-list hunter! ⭐
let win = ["I", "learned", "arrays!"]
console.log(win)Frequently asked questions
Is the “What Is an Array?” lesson free?
Yes — the full text of “What Is an Array?” is free to read here on the web, and the Javascript for Kids course includes 4 lessons in total. To practise it interactively (a built-in code editor and a 24/7 AI tutor) and unlock the rest of the Javascript for Kids course, upgrade to CoddyKit PRO.
What will I learn in “What Is an Array?”?
An array holds many values in order. You practise Javascript for Kids with hands-on code you run directly in the browser, and a 24/7 AI tutor answers your questions as you work through the lesson.
Do I need any experience to start Javascript for Kids?
No prior experience is required. Javascript for Kids on CoddyKit is structured for beginners through advanced learners; this is — lesson 1 of 4, so you can start here or from the beginning and move at your own pace.
How long does the “What Is an Array?” lesson take?
Most CoddyKit lessons take about 5–10 minutes. Each one is bite-sized and interactive, so you make steady progress and pick up exactly where you left off across the web and the app.
Can I write and run code in this Javascript for Kids lesson?
Yes. Every Javascript for Kids lesson includes a built-in code editor, so you write and run real code right in your browser and get instant AI feedback — no local setup required.