0Pricing
Javascript for Kids · Lesson

More Choices with else if

Pick between several options.

More Choices with else if is a free Javascript for Kids lesson on CoddyKit — lesson 4 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.

More Choices! 🎚️

Hi, choice master! 🌟 Sometimes we have MORE than two choices.

We use else if to add more doors to check! 🚪🚪🚪

let n = 2
if (n === 1) {
  console.log("One")
} else if (n === 2) {
  console.log("Two! ✌️")
} else {
  console.log("Something else")
}

A Chain of Choices ⛓️

else if goes between if and else.

The computer checks each door from top to bottom until one is true! 🪜

let color = "red"
if (color === "blue") {
  console.log("Sky! 🔵")
} else if (color === "red") {
  console.log("Apple! 🍎")
}

Pick a Fruit 🍓

Let us pick a treat based on a number!

Each else if is another choice. 😋

let pick = 3
if (pick === 1) {
  console.log("Apple 🍎")
} else if (pick === 2) {
  console.log("Banana 🍌")
} else if (pick === 3) {
  console.log("Cherry 🍒")
}

Only the First True One 1️⃣

The computer stops at the FIRST door that is true. The rest are skipped!

Like picking the first open door. 🚪

let age = 8
if (age > 5) {
  console.log("First true! 🎉")
} else if (age > 7) {
  console.log("Skipped!")
}

Grading a Score 🎯

Let us give a medal based on score!

Gold, silver, or bronze. 🥇🥈🥉

let score = 75
if (score > 90) {
  console.log("Gold! 🥇")
} else if (score > 70) {
  console.log("Silver! 🥈")
} else {
  console.log("Bronze! 🥉")
}

Weather Choices 🌦️

What should we do based on the weather?

Sunny, rainy, or snowy! ☀️🌧️❄️

let weather = "snow"
if (weather === "sun") {
  console.log("Play! ☀️")
} else if (weather === "rain") {
  console.log("Umbrella! 🌧️")
} else if (weather === "snow") {
  console.log("Snowman! ⛄")
}

The Final else 🛟

The else at the end catches EVERYTHING that did not match.

It is the safety net! 🪂

let pet = "fish"
if (pet === "dog") {
  console.log("Woof 🐶")
} else if (pet === "cat") {
  console.log("Meow 🐱")
} else {
  console.log("A different pet! 🐠")
}

Choosing a Level 🎮

Pick a game level based on points!

Easy, medium, or hard. 🕹️

let points = 50
if (points < 30) {
  console.log("Easy 🟢")
} else if (points < 70) {
  console.log("Medium 🟡")
} else {
  console.log("Hard 🔴")
}

Days of the Week 📅

Let us decide a fun activity for a day!

Each day gets its own choice. 🗓️

let day = "Sat"
if (day === "Mon") {
  console.log("School 🏫")
} else if (day === "Sat") {
  console.log("Park day! 🌳")
} else {
  console.log("Another day")
}

Big, Medium, or Small? 📏

Let us sort a number into a group!

Three sizes to choose from. 🐘🐰🐜

let size = 5
if (size > 8) {
  console.log("Big 🐘")
} else if (size > 3) {
  console.log("Medium 🐰")
} else {
  console.log("Small 🐜")
}

Your Choice Chain 🧒

Change the number and see which choice runs!

Try 1, 2, and 3. 🎲

let num = 2
if (num === 1) {
  console.log("One! ☝️")
} else if (num === 2) {
  console.log("Two! ✌️")
} else {
  console.log("Three or more! 🤟")
}

Quick Check ✅

Last decision question! You rock! 🤘

Choice Master! 🏆

Incredible! 🎉 Today you learned:

  • else if adds more choices
  • The computer picks the FIRST true one
  • else at the end is the safety net

You finished Yes or No Decisions! Decision genius! ⭐

let n = 1
if (n === 1) {
  console.log("I learned else if! 🎉")
}

Frequently asked questions

Is the “More Choices with else if” lesson free?

Yes — the full text of “More Choices with else if” 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 “More Choices with else if”?

Pick between several options. 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 4 of 4, so you can start here or from the beginning and move at your own pace.

How long does the “More Choices with else if” 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.

All lessons in this course

  1. Making a Choice with if
  2. Plan B with else
  3. Comparing Things
  4. More Choices with else if
← Back to Javascript for Kids