Courses
Step 6 of 11 in the Web Development path

JavaScript

JavaScript brings interactivity to web pages. If you need a web application, you'll need JavaScript too.

Lessons

  1. Lesson 1

    JavaScript Basics

    Write your first program: print with console.log(), calculate, and use let and const.

    Worth 190 XP

  2. Lesson 2

    Conditions

    Make your program decide with if, else if and else, and write conditions with ===, && and ||.

    Worth 130 XP

  3. Checkpoint

    Game Score

    Work out a game level's score, award stars, and find out whether the secret level unlocks.

    Worth 25 XP

    What you'll build

    Output

    Coins: 370Enemies: 300Time bonus: 150Score: 820Stars: 2 of 3High score: 900Secret level: locked
  4. Lesson 4

    Arrays

    Store values in an array, read them by index, and add or remove them with push() and pop().

    Worth 135 XP

  5. Lesson 5

    Loops

    Repeat code with while and for, go through arrays with for...of, and add up or count values.

    Worth 140 XP

  6. Checkpoint

    Hangman

    Reveal the guessed letters of a Hangman word, list the wrong guesses, and decide who won.

    Worth 25 XP

    What you'll build

    Output

    _ A _ A S _ R _ _ T Hidden letters: 5Wrong guesses: ["E", "O"]Mistakes: 2Lives left: 4
  7. Lesson 7

    Functions

    Write your own functions with parameters and return values, and shorter ones with =>.

    Worth 105 XP

  8. Lesson 8

    Objects

    Group values into objects, read and change their properties, and loop over arrays of objects.

    Worth 100 XP

  9. Lesson 9

    Array Methods

    Replace loops with filter(), map() and find(), and sort arrays with sort().

    Worth 120 XP

  10. Checkpoint

    Football League

    Keep a football league table: work out points, find the leader, and update it after a match.

    Worth 25 XP

    What you'll build

    Output

    Lions: 10Eagles: 8Sharks: 4Wolves: 0Leader: LionsUnbeaten: ["Lions", "Eagles"]Eagles 2:1 LionsLions: 10Eagles: 11Sharks: 4Wolves: 0Leader: EaglesUnbeaten: ["Eagles"]
  11. Lesson 11

    JavaScript on Web Pages

    Find elements with querySelector(), make buttons react to clicks, and build a to-do list.

    Worth 110 XP

  12. Lesson 12

    Events and Forms

    Search a list as the user types, react to keys like Enter, and check a form when it's sent.

    Worth 110 XP

  13. Checkpoint

    Sign-Up Form

    Make a sign-up form check the user name, email, password and age, and welcome the new user.

    Worth 30 XP

    What you'll build
    index.html
    The sign-up form after clicking Sign up with nothing filled in: red messages next to the fields say what's missing.
  14. Lesson 14

    Timers and Waiting

    Run code later with setTimeout() and setInterval(), and wait for results with async and await.

    Worth 110 XP

  15. Lesson 15

    Data from a Server

    Load JSON from a server with fetch(), draw the page from it, and save data in localStorage.

    Worth 105 XP

  16. Checkpoint

    Film Night

    Build a film night app: load films, filter them by genre and title, and save favorites.

    Worth 35 XP

    What you'll build
    index.html
    The Film Night app: a genre menu, a search box and a list of films with their year, genre and length, each with a star button for favorites.
  17. Lesson 17

    Final Project

    Build a shopping list app that adds up prices, crosses off bought items, and remembers them.

    Worth 95 XP

    What you'll build
    index.html
    The shopping list app: four items with prices, the bought bread crossed out, the amount to pay, and a form for adding items.

About the course

JavaScript makes web pages interactive, and it's the one programming language every browser understands. The course starts with the basics, variables, calculations and conditions, then covers arrays, loops, functions, objects and array methods, and finally JavaScript on a web page: events and forms, timers, and data that the page loads from a server and saves.

Along the way, you write programs and pages on your own, such as Game Score, Hangman, Football League, Sign-Up Form and Film Night, and in the final project you build a small app: a shopping list that adds up prices, checks what you type, lets you cross items off and remembers them for next time.