for Loops: Coding lesson for kids
In this lesson, children learn to write a for loop with an initializer, condition, and increment.
for (let i = 0; i < 4; i++) { ... }: Repeats the block 4 times, with i taking the values 0, 1, 2, 3.
console.log(i);: Runs once per loop — prints 0, then 1, then 2, then 3.
This lesson is part of JavaScript in Coding at Pearls Valley Academy — What makes a webpage actually do something.
Each lesson starts with a short narrated, animated explanation, then hands-on practice. A wrong answer gets a gentle hint, never a penalty, and children earn stars and pearls as they go.
- All Coding lessons
- What Is JavaScript For?
- console.log()
- Variables: let vs const
- Data Types: String, Number, Boolean
- Order the Lines
- Comments: What Doesn't Run
- Boolean Operators: && || !
- Template Literals & Type Conversion
- if / else if / else
- while Loops
- Arrays: Index & push
- Array Methods: length, includes, for-of