White belt
Variables, strings, if and else, and loops. Start here. 14 exercises.
- Convert days to seconds Turn days into seconds. After Grade 1: Variables: Boxes With Labels.
- Write a greeting function Build a friendly greeting from a name. After Grade 2: Data Types: What Goes in the Boxes?.
- Get the initials from a name Turn a full name into initials. After Grade 2: Data Types: What Goes in the Boxes?.
- Work out a bill with a service charge Work out a bill with a service charge. After Grade 3: Operators: Math, Comparisons & Logic.
- Check if a number is even or odd Label any whole number. After Grade 3: Operators: Math, Comparisons & Logic.
- Find the largest of three numbers Find the largest number without Math.max. After Grade 4: Making Decisions: if, else & Friends.
- Turn a score into a letter grade Turn a score into a letter grade. After Grade 4: Making Decisions: if, else & Friends.
- Check for a leap year Is February 29 a real day this year? After Grade 4: Making Decisions: if, else & Friends.
- Name the day of the week with switch Use switch to name a day. After Grade 4: Making Decisions: if, else & Friends.
- Add up the numbers from 1 to n Sum every number from 1 to n. After Grade 5: Loops: Doing Things Over and Over.
- Count the vowels in a string Count the a, e, i, o and u in any text. After Grade 5: Loops: Doing Things Over and Over.
- Reverse a string Reverse a string with a loop. After Grade 5: Loops: Doing Things Over and Over.
- FizzBuzz The world’s most famous coding interview question. After Grade 5: Loops: Doing Things Over and Over.
- Print a staircase pattern with nested loops Draw a staircase with nested loops. After Grade 5: Loops: Doing Things Over and Over.
Green belt
Arrays, objects, functions, errors and closures. 13 exercises.
- Find the average of an array Average a list of scores. After Grade 7: Arrays: Lists of Things.
- Check if a string is a palindrome Does it read the same backwards? After Grade 7: Arrays: Lists of Things.
- Remove duplicates from an array Remove repeated items, keeping the order. After Grade 7: Arrays: Lists of Things.
- Split an array into chunks Split an array into groups. After Grade 7: Arrays: Lists of Things.
- Convert a string to title case Capitalize the first letter of every word. After Grade 7: Arrays: Lists of Things.
- Find the longest word in a sentence Find the longest word in a sentence. After Grade 7: Arrays: Lists of Things.
- Count how often each word appears Count how often each word appears. After Grade 8: Objects: Describing Things With Labels.
- Merge default settings with user options Combine defaults with a user’s choices. After Grade 8: Objects: Describing Things With Labels.
- Summarize an array of objects Summarize a shopping list of objects. After Grade 8: Objects: Describing Things With Labels.
- Throw an error when dividing by zero Throw a helpful error instead of returning Infinity. After Summer School: Debugging: Becoming a Bug Detective.
- Find and fix three bugs This function has three bugs. Find them all! After Summer School: Debugging: Becoming a Bug Detective.
- Build a counter with a closure Use a closure to build custom counters. After Grade 9: Scope, Hoisting & Closures.
- Write a once() function Wrap a function so it only ever runs once. After Grade 9: Scope, Hoisting & Closures.
Black belt
Array methods, async code, classes and small real-world tools. 16 exercises.
- Group array items by a key Sort things into labeled groups. After Grade 10: Array Power Tools: map, filter & reduce.
- Sort and format a leaderboard Filter, sort and format the top players. After Grade 10: Array Power Tools: map, filter & reduce.
- Flatten a nested array Turn nested arrays into one flat list. After Grade 10: Array Power Tools: map, filter & reduce.
- Check if two words are anagrams Are two words made of the same letters? After Grade 10: Array Power Tools: map, filter & reduce.
- Write a Caesar cipher Send secret messages by shifting letters. After Grade 10: Array Power Tools: map, filter & reduce.
- Convert numbers to Roman numerals Convert numbers like the ancient Romans. After Grade 10: Array Power Tools: map, filter & reduce.
- Write a memoize function Cache results so slow work only happens once. After Grade 13: Modern JavaScript Power-Ups.
- Clean up messy data Tidy messy records with modern JavaScript. After Grade 13: Modern JavaScript Power-Ups.
- Return a promise that resolves after a delay Your first asynchronous function. After Freshman Year: Asynchronous JavaScript: Waiting Without Freezing.
- Add a timeout to a promise Give up on a promise that takes too long. After Freshman Year: Asynchronous JavaScript: Waiting Without Freezing.
- Run promises in parallel and handle failures Cook in parallel and handle failures. After Freshman Year: Asynchronous JavaScript: Waiting Without Freezing.
- Build a stack class A class for last-in, first-out storage. After Sophomore Year: Classes & Object-Oriented JavaScript.
- Classes and inheritance: a virtual pet Classes, inheritance and a little game logic. After Sophomore Year: Classes & Object-Oriented JavaScript.
- Parse CSV text into objects Turn spreadsheet text into objects. After Junior Year: Modules, Node.js & npm: Working Like a Pro.
- Build a mini test runner Build the thing that checks your code. After Junior Year: Modules, Node.js & npm: Working Like a Pro.
- Write the logic for a quiz app The state logic behind a quiz app. After Senior Year: Capstone Projects: Build Real Apps.
Want the lessons too?
CurlyScript is a free game that teaches JavaScript from zero: short lessons, an explanation after every answer, and a test at the end of every grade.