0Pricing
Javascript for Kids · Lesson

Getting Items by Number

Pick items using their position.

Grabbing Treasures 🤲

Hi, treasure grabber! 🌟 How do we get ONE item out of a list?

We use its position number inside [ ]! 🔢

let treasure = ["gold", "gem", "crown"]
console.log(treasure[0])

Counting Starts at Zero! 0️⃣

Surprise! Lists count from 0, not 1!

The first item is at position [0]. 🤯

let pets = ["cat", "dog", "fish"]
console.log(pets[0])

All lessons in this course

  1. What Is an Array?
  2. Getting Items by Number
  3. Adding and Removing Items
  4. Looping Through a List
← Back to Javascript for Kids