← Lessons CREATOR PATH

🌸 Array Adventure

Lesson 14 of 20
🌸
Themed Universe
Cherry Blossom Garden
Arrays are garden lists β€” store your koi fish & petals, then pick them by position! 🐟🌸
🎯 Missions
Add 3 koi fish to the pond using .push() today!
Use ALL 4 array skills: create [], index [0], .length, .push()
Solve all 5 garden challenges β€” no hints!
● ● ● pond.js JavaScript
1

        
      
garden pond LIVE
Click β–Ά Run to see your garden pond…

🌸 Garden Puzzle Step 1 of 5

Create a fish array with 3 koi names and print it!

πŸ’‘ Hint: Declare: var fish = ["Kohaku", "Sanke", "Ogon"]; then console.log(fish);

🌸 Array Adventure

In Lesson 13 you mastered strings β€” single pieces of text. Today in the 🌸 Cherry Blossom Garden, you'll learn to store lists of things! A list in JavaScript is called an array. Imagine a pond full of koi fish, or a branch full of petals β€” arrays let you keep them all together, pick any one by its position, count them, and add new ones. Let's tend the garden with code!

🌸 Array Toolkit
var fish = ["A", "B", "C"];β†’ create an array (a list)
fish[0]β†’ "A" (first item β€” index starts at 0!)
fish.length→ 3 (count how many items)
fish.push("D")β†’ adds "D" to the end of the list
fish[fish.length - 1]β†’ always gets the LAST item
πŸ“¦ Arrays store lists: ["red", "blue", "green"] β€” items go inside [ ]
πŸ”’ Index picks an item: fish[0] gets the 1st, fish[1] gets the 2nd. Starts at 0!
πŸ“ .length counts items: fish.length β†’ how many are in the array
βž• .push() adds to the end: fish.push("new") makes the list longer
🌸 Arrays hold strings, numbers, or any mix β€” they're the most useful tool in coding!