← Back to courses

Course

JavaScript & Modern JavaScript (ES6+)

99 lessons across 12 modules

Beginner to advanced, as one course - ES6 is part of the language, not a sequel to it. Fundamentals, control flow, arrays and objects, the modern syntax, functional array methods, closures and this, async and the event loop, the DOM, modules and tooling, prototypes and classes, and debugging - ending in five projects. The road is laid out in full; lessons are being written one at a time.

Course12 modules99 lessonsEach heading below is a module (one topic). Each card under it is a lesson. Start with Module 1.
Solid: ready (0)Dashed: coming soon (99)
Module 1 of 127 lessonsComing soon

JavaScript Fundamentals

What the language is, and the values it works with

What is JavaScript?

1

The language of the browser, now running almost everywhere else too.

The same function running in a browser tab and in Node

Lesson 1planned

JavaScript Runtime

2

Engine, runtime, and host - and why the browser and Node differ.

document existing in one runtime and not the other

Lesson 2planned

Variables

3

Naming a value, and the three keywords that do it differently.

The same program with var, let, and const

Lesson 3planned

Data Types

4

Seven primitives and one object type, and typeof getting one wrong.

Why typeof null is "object"

Lesson 4planned

Operators

5

Arithmetic, comparison, logical - and == against ===.

Six comparisons that surprise everyone once

Lesson 5planned

Type Conversion

6

Explicit conversion, implicit coercion, and truthiness.

"5" + 1 against "5" - 1

Lesson 6planned

Strict Mode

7

Opting out of the silent failures, and why modules are strict already.

An assignment to an undeclared name, with and without it

Lesson 7planned
Module 2 of 129 lessonsComing soon

Control Flow and Functions

Making decisions, repeating work, and naming it

if / else

8

Branching on a condition, and the truthiness rules it applies.

Validating a form field in three branches

Lesson 8planned

switch

9

Matching one value against many, and the fall-through trap.

A missing break running the next case too

Lesson 9planned

for Loop

10

The counted loop, and its three parts.

Printing a numbered list

Lesson 10planned

while Loop

11

Looping until a condition changes, and making sure it does.

Retrying until success or a limit

Lesson 11planned

do...while

12

The loop that always runs at least once.

Prompting until the input is valid

Lesson 12planned

Functions

13

Declarations against expressions, and hoisting between them.

Calling a function above the line that defines it

Lesson 13planned

Function Parameters

14

Parameters against arguments, and what happens to missing ones.

A call with too few arguments, and undefined arriving

Lesson 14planned

Return Values

15

Returning, returning nothing, and the automatic-semicolon trap.

A return on its own line that returns undefined

Lesson 15planned

Scope

16

Global, function, and block scope - and which keyword gets which.

A var leaking out of an if block

Lesson 16planned
Module 3 of 127 lessonsComing soon

Arrays and Objects

The two structures almost everything is built from

Arrays

17

Ordered lists, zero-based indexes, and length.

Reading the last element without knowing the length

Lesson 17planned

Array Methods

18

push, pop, shift, unshift, slice, splice - which ones mutate.

slice leaving the array alone while splice changes it

Lesson 18planned

Objects

19

Keys and values, and the reference that makes copying tricky.

Two variables and one object

Lesson 19planned

Object Properties

20

Dot against bracket access, adding, deleting, and checking.

A property name held in a variable

Lesson 20planned

Object Methods

21

Functions stored on objects, plus keys, values, and entries.

Looping over an object with Object.entries

Lesson 21planned

Nested Objects

22

Objects inside objects, and reaching into them safely.

A user with an address with a city

Lesson 22planned

Destructuring

23

A first look - reading several values out in one line.

Pulling name and email out of a user object

Lesson 23planned
Module 4 of 129 lessonsComing soon

Modern JavaScript (ES6+)

The syntax that changed how the language is written

let and const

24

Block scope, the temporal dead zone, and why var is retired.

A loop of timeouts printing the wrong number with var

Lesson 24planned

Arrow Functions

25

Shorter syntax, implicit return, and no own this.

Returning an object literal and needing the brackets

Lesson 25planned

Template Literals

26

Interpolation, multi-line strings, and tagged templates.

Building a message without a single plus sign

Lesson 26planned

Default Parameters

27

Defaults evaluated at call time, and only for undefined.

A default that does not apply when null is passed

Lesson 27planned

Rest Operator

28

Collecting the remaining arguments or properties into one value.

A sum() that takes any number of arguments

Lesson 28planned

Spread Operator

29

Expanding an array or object in place - and copying one level deep.

Merging two objects, with the right-hand one winning

Lesson 29planned

Destructuring

30

The full syntax - defaults, renaming, nesting, and in parameters.

A function signature that documents its options object

Lesson 30planned

Enhanced Object Literals

31

Shorthand properties, methods, and computed keys.

An object built from variables with no repetition

Lesson 31planned

Optional Chaining

32

?. and ??, and the difference between ?? and ||.

A count of 0 surviving ?? and lost to ||

Lesson 32planned
Module 5 of 1210 lessonsComing soon

Array and Object Programming

Transforming data without writing the loop

map()

33

Transforming every element into a new array of the same length.

Prices with tax added, the original untouched

Lesson 33planned

filter()

34

Keeping the elements that pass a test.

Active users out of all users

Lesson 34planned

reduce()

35

Folding an array into one value, and the initial value that matters.

A cart total, and reduce on an empty array throwing

Lesson 35planned

find()

36

The first element that matches, or undefined.

Looking up a user by id

Lesson 36planned

findIndex()

37

The position of the first match, or -1.

Replacing one item in place by its position

Lesson 37planned

some()

38

True as soon as one element passes, and it stops there.

Does any item in the cart need shipping?

Lesson 38planned

every()

39

True only if all pass - and true for an empty array.

Validating that every field is filled

Lesson 39planned

includes()

40

Membership by value, and why it finds NaN when indexOf does not.

Checking a role against an allowed list

Lesson 40planned

sort()

41

Sorting in place, the string default, and the comparator.

[10, 9, 1].sort() giving [1, 10, 9]

Lesson 41planned

flat()

42

Flattening nested arrays, and flatMap for the common case.

Every lesson from every module in one list

Lesson 42planned
Module 6 of 129 lessonsComing soon

Functions and Advanced Concepts

Functions as values, closures, and this

First-Class Functions

43

Functions stored, passed, and returned like any other value.

A table of handlers keyed by action name

Lesson 43planned

Higher-Order Functions

44

Functions that take or return functions.

Writing your own map to see there is no magic

Lesson 44planned

Callbacks

45

Passing a function for someone else to call later.

A sort comparator as the simplest callback there is

Lesson 45planned

Closures

46

A function remembering the scope it was created in.

A counter with genuinely private state

Lesson 46planned

Lexical Scope

47

Scope decided by where code is written, not where it is called.

The same function called from two places, one result

Lesson 47planned

this

48

Decided by how a function is called - four rules and the arrow exception.

A method losing this when passed as a callback

Lesson 48planned

call()

49

Invoking a function with an explicit this.

Borrowing one object method for another

Lesson 49planned

apply()

50

call with an array of arguments, and what spread replaced.

Math.max over an array, before and after spread

Lesson 50planned

bind()

51

A new function with this fixed permanently.

An event handler that keeps its object

Lesson 51planned
Module 7 of 1210 lessonsComing soon

Asynchronous JavaScript

One thread, and how it still does several things

Watch the event loop step by step →

Synchronous vs Asynchronous

52

Blocking against non-blocking, on a single thread.

A long loop freezing the page

Lesson 52planned

Call Stack

53

What is running right now, and the overflow you get from recursion.

Reading a stack trace from the bottom up

Lesson 53planned

Web APIs

54

Timers, fetch, and events - handled outside the engine.

Where a setTimeout actually waits

Lesson 54planned

Event Loop

55

Tasks, microtasks, and the order they really run in.

A promise callback beating a setTimeout of zero

Lesson 55planned

Callbacks

56

Asynchronous callbacks, error-first style, and the pyramid.

Four nested requests and nowhere to put the error

Lesson 56planned

Promises

57

A value that arrives later - states, then, catch, and chaining.

The same four requests, flat

Lesson 57planned

async/await

58

Promises written to read like synchronous code.

A sequential await that should have been parallel

Lesson 58planned

Promise.all()

59

Running in parallel, and failing on the first rejection.

Three requests at once, one failure losing all three

Lesson 59planned

Promise.allSettled()

60

Waiting for every result, success or failure.

A dashboard that shows what loaded and what did not

Lesson 60planned

Error Handling

61

try/catch with await, and the unhandled rejection.

A rejected promise nobody was listening to

Lesson 61planned
Module 8 of 129 lessonsComing soon

DOM and Browser APIs

Reading and changing the page

DOM

62

The page as a tree of objects your code can change.

The HTML source against the live DOM

Lesson 62planned

Selecting Elements

63

querySelector, querySelectorAll, and live against static lists.

A NodeList that does not update when the page does

Lesson 63planned

Modifying Elements

64

Text, attributes, classes, and creating new nodes.

textContent against innerHTML, and why it matters

Lesson 64planned

Events

65

Listening, the event object, and removing a listener.

A listener that cannot be removed because it was anonymous

Lesson 65planned

Event Bubbling

66

Events travelling up the tree, and stopping them.

A click on a button also firing its card

Lesson 66planned

Event Delegation

67

One listener on a parent handling every child.

A list whose new items work without new listeners

Lesson 67planned

Forms

68

Reading values, validating, and preventing the default submit.

FormData collecting a whole form in one call

Lesson 68planned

Local Storage

69

Persisting strings in the browser, and serialising everything else.

Saving an object and getting "[object Object]" back

Lesson 69planned

Browser APIs

70

Fetch, history, clipboard, and intersection observer.

Lazy-loading images as they scroll into view

Lesson 70planned
Module 9 of 128 lessonsComing soon

Modules and Tooling

Splitting code across files, and the ecosystem around it

ES Modules

71

The standard module system, and what changes inside one.

A script tag with type="module"

Lesson 71planned

import

72

Named, default, namespace, and dynamic imports.

Loading a heavy library only when a button is clicked

Lesson 72planned

export

73

Named against default exports, and why named usually wins.

A rename that a named export makes safe

Lesson 73planned

CommonJS

74

require and module.exports, and living alongside ES modules.

An ESM package that CommonJS code cannot require

Lesson 74planned

npm

75

Installing, dependencies against devDependencies, and the lockfile.

Two machines installing different versions without a lockfile

Lesson 75planned

package.json

76

The manifest - fields that matter and the ones that do not.

Reading a package.json and knowing what the project is

Lesson 76planned

npm Scripts

77

Naming the commands a project runs.

dev, build, test, and lint as the project contract

Lesson 77planned

Environment Variables

78

Configuration outside the code - and the browser caveat.

A secret that ended up in a frontend bundle

Lesson 78planned
Module 10 of 129 lessonsComing soon

Advanced JavaScript

Prototypes, classes, and the less familiar built-ins

Prototypes

79

How objects share behaviour without copying it.

A method found on the prototype rather than the object

Lesson 79planned

Prototype Chain

80

Lookup walking up the chain until it finds a match or reaches null.

Why every array has toString

Lesson 80planned

Classes

81

Class syntax - and the prototypes still underneath it.

A class and the prototype code it becomes

Lesson 81planned

Inheritance

82

extends, super, and when composition is the better answer.

A class hierarchy three levels deep, and its replacement

Lesson 82planned

Getters and Setters

83

Computed properties, and validating on assignment.

A fullName that stays in sync with its parts

Lesson 83planned

Iterators

84

The protocol behind for...of and spread.

Making a custom object iterable

Lesson 84planned

Generators

85

Functions that pause, and the lazy sequences they make.

An infinite id generator that never runs out of memory

Lesson 85planned

Symbols

86

Unique keys, and the well-known symbols the language uses.

Symbol.iterator as the hook for the previous lesson

Lesson 86planned

WeakMap and WeakSet

87

Holding data about objects without keeping them alive.

Caching per DOM node without leaking memory

Lesson 87planned
Module 11 of 127 lessonsComing soon

Error Handling and Debugging

Failing clearly, and finding out why

try/catch

88

Catching, finally, and what not to catch.

A catch that swallows an error and hides the bug

Lesson 88planned

throw

89

Throwing Error objects, never strings.

A thrown string with no stack trace

Lesson 89planned

Custom Errors

90

Extending Error so callers can tell failures apart.

ValidationError and NotFoundError handled differently

Lesson 90planned

Debugging

91

A method, not guessing - reproduce, isolate, then fix.

Narrowing a bug to one line by halving

Lesson 91planned

Browser DevTools

92

Console, Sources, Network, and the panels that answer questions.

Finding a failed request and its response body

Lesson 92planned

Breakpoints

93

Line, conditional, and event breakpoints - and stepping.

Pausing only on the loop iteration that goes wrong

Lesson 93planned

Debugging Async Code

94

Async stack traces, and breaking inside promise chains.

Tracing an error back across an await

Lesson 94planned
Module 12 of 125 lessonsComing soon

JavaScript Projects

Five builds that use the whole course

Next: the React course →

Calculator

95

DOM, events, and state held in plain variables.

Chained operations and a clear button that really clears

Lesson 95planned

Todo Application

96

Arrays of objects, rendering, delegation, and local storage.

Add, complete, filter, and survive a refresh

Lesson 96planned

Weather Application

97

Fetch, async/await, loading and error states.

A search that handles an unknown city gracefully

Lesson 97planned

API-based Application

98

Several endpoints, parallel requests, and a service layer.

A dashboard assembled with Promise.allSettled

Lesson 98planned

Final JavaScript Project

99

Modules, classes, async, and the DOM, designed and built end to end.

A project planned before it is written, and reviewed after

Lesson 99planned