Programming for Kids
A JavaScript course in seven lessons, right in the browser, all the way to writing Euclid’s algorithm yourself.
Each lesson explains an idea with examples to change and run, then gives exercises that are checked automatically, with a hint and a solution. Your code and your solved exercises are kept in this browser.
Lesson 1
Your first program
Printing text and numbers with console.log, calculating, and the remainder of a division, %.
Lesson 2
Variables
Keeping values in boxes with a name, changing them, and swapping two variables.
Lesson 3
Making decisions
Comparing, true or false, and choosing what to do with if and else: even or odd, leap years.
Lesson 4
Loops
Repeating with while and for: counting, adding up, times tables and divisors.
Lesson 5
Functions
Naming a piece of program, giving it values and returning an answer with return.
Lesson 6
Arrays and objects
Lists of values and values with a name: sums, the largest value and common divisors.
Lesson 7
Project: Euclid’s algorithm
Writing the code of the Euclid page yourself, racing it against a slow search, and simplifying fractions.