The AI Starting Point

Courses / JavaScript Foundations

JavaScript Foundations

Make web pages come alive: variables, decisions, functions, arrays, and reacting to clicks in the browser.

4 lessonsAbout 3 hoursComplete beginner

Progress

Loading…

Not sure yet? Get the free starter lesson first.

Enter your email and we will send it to you.

$15 $20
R255 (about $15)

What you will be able to do

  • Use variables, numbers, text and booleans in JavaScript
  • Write decisions, loops and functions
  • Work with arrays and objects
  • Change a web page with the DOM
  • Respond to clicks and form input

What you need: A browser and a text editor. Basic HTML helps (see HTML Foundations) but is not required.

Lessons

  1. 1Values and variables40 minutes · Lesson quiz
    • Where JavaScript runs
    • const and let
    • Strings, numbers and template literals
    • Worked example: a price total
    • Try it: a console experiment
  2. 2Decisions, loops and functions50 minutes · Lesson quiz
    • Making decisions
    • Loops
    • Functions
    • Worked example: FizzBuzz-style check
    • Try it: a grade function
  3. 3Arrays and objects45 minutes · Lesson quiz
    • Arrays keep lists
    • Objects keep records
    • map, filter and find
    • Worked example: a course list
    • Try it: a reading list
  4. 4The DOM, events and a small project55 minutes · Lesson quiz
    • The page as a tree
    • Events
    • Keeping state
    • Worked example: a click counter
    • Project: a tip calculator

Final project: a to-do list

Build a page where you can type a task, press Add and see it appear in a list, with a button to remove each task. Keep tasks in an array and redraw the list from it.

Self-check: the array is the single source of truth, empty tasks are rejected and the page works by keyboard.

Next steps

  • Take the Beginner Web Development course to combine HTML, CSS and JavaScript.
  • Take Git and GitHub Basics to save and share your code.
Start lesson 1