0Pricing
Javascript for Kids · Lesson

Adding and Removing Items

Use push and pop to change your list.

Adding and Removing 📥📤

Hi, list keeper! 🌟 We can ADD and REMOVE items from a list!

We use .push() to add and .pop() to remove. 🪄

let bag = ["apple"]
bag.push("banana")
console.log(bag)

Push to Add 📥

.push() adds a new item to the END of the list!

Like dropping a new treasure into the chest. 💎

let chest = ["gold"]
chest.push("gem")
console.log(chest)

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