Grade 1
Variables: boxes with labels
Three lessons, then a test against Buggsy.
What you’ll learn
- A variable is a named box that holds a value:
let age = 25; =means put into (assignment), not “equals”.- Use
letonly the first time. After that, just use the name:age = 26; constmakes a locked box that can’t be reassigned. Use it by default.- Avoid
var: it’s the old way, with confusing rules. - Names can use letters, digits,
_and$, can’t start with a digit, and are case-sensitive. Use camelCase. - A variable that was declared but never given a value is
undefined.
The lessons
- Boxes with labels Teach your program to remember things with let.
- const, var and good names Locked boxes, Grandpa’s old box, and the rules for naming.
- Variables working together undefined, math with boxes, updating values and the swap puzzle.
Grade 2
Data types: what’s in the box?
Three lessons, then a test against Buggsy.
What you’ll learn
- Strings are text in quotes:
"hi",'hi'or `hi`. - Template literals use backticks and
${ }to drop values into text. .length,[index]and methods like.toUpperCase(),.includes()and.slice()work on strings.- Numbers include
NaN(not a number) andInfinity.0.1 + 0.2isn’t exactly0.3! - Booleans are
trueorfalse. undefinedmeans “not set yet”;nullmeans “deliberately empty”.typeoftells you a value’s type.Number(),String()andBoolean()convert between types.
The lessons
- Strings and template literals Text in quotes, escape characters, and the easy way to build sentences.
- String superpowers length, indexes and the most useful string methods.
- Numbers, booleans and nothing NaN, Infinity, true and false, undefined vs null, typeof and conversions.
Grade 3
Operators: math, comparisons and logic
Three lessons, then a test against Buggsy.
What you’ll learn
- Math:
+ - * /, remainder%, power. Brackets first, then, then* / %, then+ -. - Shortcuts:
x += 5,x -= 2,x *= 3,x++,x--. - Comparisons give booleans:
> < >= <=. - Always use
===and!==. The loose==converts types and causes surprises. - Logic:
&&(and),||(or),!(not). Math.round,Math.floor,Math.ceil,Math.max,Math.minandMath.random().- A random whole number from 1 to 6:
Math.floor(Math.random() * 6) + 1.
The lessons
- Math class is back Arithmetic, remainders, powers, order of operations and shortcuts.
- Comparisons and equality Bigger, smaller, equal, and why === beats ==.
- Logic and the Math object AND, OR, NOT, rounding and random numbers.
Grade 4
Making decisions
Three lessons, then a test against Buggsy.
What you’ll learn
if (condition) { … }runs code only when the condition is true.elseis the backup plan;else ifadds more choices. The first true branch wins.- Falsy values:
false,0,"",null,undefined,NaN. Everything else is truthy. - Combine conditions with
&&and||, and nestifs insideifs. - The ternary
condition ? a : bis a one-line if/else that gives back a value. switchcompares one value against manycases. Don’t forgetbreak!
The lessons
- if, else and else if Let your program choose what to do.
- Truthy, falsy and combining Values that act like true or false, and smarter conditions.
- Ternaries and switch One-line decisions, and picking from a menu of cases.
Grade 5
Loops: doing things again and again
Three lessons, then a test against Buggsy.
What you’ll learn
while (condition) { … }repeats while the condition is true.- If the condition never becomes false, you get an infinite loop.
for (let i = 0; i < 5; i++) { … }is the counting loop: start, condition, step.- The accumulator pattern: start a total at 0 and add to it inside the loop.
do…whilealways runs at least once.breakexits the loop;continueskips to the next round.for (const char of "hello")loops over each character (or each item of an array).
The lessons
- while and for Make the computer repeat itself without getting tired.
- Loop patterns Accumulators, do…while, break and continue.
- Strings, nested loops and FizzBuzz Loop over text, put loops inside loops, and beat the classic interview question.
Class starts whenever you’re ready
Every lesson is free, there’s nothing to sign up for, and your progress saves as you go.