← Choose another age

Ages 8–10

Write actual JavaScript β€” variables, for loops, if/else, and arrays β€” and watch every line animate.

1

Your First Variable

Typing the same number over and over is boring β€” and if you want to change it, you have to change every line. Programmers store numbers in a box with a name. That box is called a variable.

Badge: πŸ… Variable Keeper

2

Loops: Do It Ten Times

A penguin has to waddle across the whole ice sheet. Writing 10 move lines is slow. A for loop says: 'do this 10 times' in one line.

Badge: πŸ… Loop Learner

3

Using the Counter

The loop counter i isn't just for counting β€” you can use it inside the loop. Watch a kangaroo take bigger and bigger hops as i grows.

Badge: πŸ… Counter Coder

4

If / Else: Making Decisions

A fox reaches a river. If it has enough energy it leaps across; if not, it stops for a rest. Code can choose between two paths using if and else.

Badge: πŸ… Decision Maker

5

Arrays: A List of Animals

One variable holds one value. An array holds a whole list β€” perfect for a parade of animals you can march through with a loop.

Badge: πŸ… List Master

6

While: Keep Going Until…

Mission control counts down from 5 to 1, then launches. A while loop keeps repeating for as long as something stays true.

Badge: πŸ… Countdown Coder

7

Random: A Race Nobody Can Predict

Two racers, and even you don't know who wins. Math.random() gives a surprise number every time you press Run.

Badge: πŸ… Chance Coder

8

Climb a Staircase

A bird climbs an invisible staircase: a bit forward, a bit up, again and again. Two commands inside one loop make a zig-zag pattern.

Badge: πŸ… Pattern Builder

9

Even or Odd Stripes

A car drives through the paint shop again and again. On even trips it comes out red, on odd trips blue. The trick is the remainder operator %.

Badge: πŸ… Remainder Rookie

10

Traffic Light Logic

A car obeys a traffic light. Red means stop, yellow means get ready, green means go. Three possible answers means you need else if.

Badge: πŸ… Logic Driver

11

Grow, Shrink, Repeat

A tree breathes: it grows, grows, then shrinks back. Loops don't just move things β€” they can change size, colour, and anything else.

Badge: πŸ… Cycle Coder

12

Project: Obstacle Course

Time to combine everything. A rabbit must cross an obstacle course: it hops the rocks, sprints the straights, and celebrates at the finish.

Badge: πŸ… Course Builder

Mini projects to try

🎨 Obstacle Course🎨 Random Race🎨 Traffic Light🎨 Animal Parade🎨 Staircase Climb