Skip to content
All courses
JavaScriptIntermediate

Modern JavaScript

Write JavaScript the way working developers do: destructuring, array methods, closures, classes, Map and Set, error handling and async code with promises.

Recommended first: JavaScript Fundamentals. This course builds on it.

Free to browse. You sign in at the first lesson so your progress is saved.

What you will be able to do

  • Unpack and combine data with destructuring, spread and rest
  • Transform lists with map, filter, reduce and sort
  • Model data with classes, Map and Set
  • Handle errors with try, catch and your own error types
  • Write asynchronous code with promises and async/await

Syllabus

7 modules and 23 lessons. Each lesson is a short read followed by an exercise with tests.

Module 1

Destructuring and spread

Pull values out of objects and arrays, combine them with spread and rest, and read data that might be missing.4 lessons, about 55 min
  1. 1Destructuring objectsCopy several properties into variables in one line, with new names and defaults.12 min
  2. 2Destructuring arrays and parametersUnpack arrays by position and destructure objects right in a function signature.14 min
  3. 3Spread and restUse three dots to expand arrays and objects, or to gather leftover values.15 min
  4. 4Optional chaining and ??Read nested data safely and choose fallbacks that respect 0 and empty strings.14 min
Module 2

Functions in depth

Write compact arrow functions, pass functions around as values, and use closures to keep private state.3 lessons, about 43 min
  1. 5Arrow functionsA shorter way to write functions, with an implicit return for one-line bodies.12 min
  2. 6Functions as valuesPass a function into another function, and let the caller decide what happens.15 min
  3. 7ClosuresFunctions remember the variables around them, which lets you keep private state.16 min
Module 3

Array methods in depth

Transform, filter, total, search and sort lists with the built-in array methods, then chain them together.5 lessons, about 1.5 hours
  1. 8Transforming lists with map and filterBuild a new array by changing every item, or by keeping only some of them.14 min
  2. 9Adding things up with reduceBoil a whole array down to one value, such as a total or a tally.18 min
  3. 10Searching with find, some and everyGet the first matching item, or ask a yes or no question about a whole list.14 min
  4. 11Sorting with comparatorsSort numbers, text and objects correctly, without changing data you want to keep.18 min
  5. 12flat, flatMap and chainingFlatten nested lists and chain several array methods into one clear pipeline.18 min
Module 4

Classes

Bundle data and behaviour together with classes, add getters and static helpers, and build on one class with another.3 lessons, about 49 min
  1. 13Constructors and methodsDefine a class, create objects from it with new, and give them methods.16 min
  2. 14Getters and static methodsWork out values on the fly with get, and attach helpers to the class itself with static.15 min
  3. 15Extending a classBuild a specialised class on top of another with extends, and reuse the parent with super.18 min
Module 5

Map and Set

Store key and value pairs with Map, and keep collections of unique values with Set.2 lessons, about 29 min
  1. 16Key and value pairs with MapA dedicated structure for looking values up by key, with a size and a reliable order.15 min
  2. 17Unique values with SetKeep each value once, remove duplicates and check membership quickly.14 min
Module 6

Error handling

Signal problems with throw, recover from them with try and catch, clean up with finally, and define your own error types.3 lessons, about 45 min
  1. 18Throwing and catching errorsStop a function when something is wrong, and handle the problem without crashing the program.15 min
  2. 19Cleaning up with finallyRun code whether or not something went wrong.12 min
  3. 20Your own error typesExtend Error to create specific error classes, and handle each kind differently.18 min
Module 7

Asynchronous JavaScript

Work with values that arrive later: promises, then and catch, async and await, and running several tasks at once.3 lessons, about 54 min
  1. 21PromisesRepresent a result that is not ready yet, and react when it arrives or fails.18 min
  2. 22async and awaitWrite asynchronous code that reads top to bottom, with try and catch for failures.18 min
  3. 23Running tasks together with Promise.allStart several tasks at once and wait for all of them, keeping the results in order.18 min

After this course

Where to go next

This course builds on what you learn in Modern JavaScript.

  • JavaScriptIntermediate

    JavaScript Project: Room Bookings

    Build a room-booking report in three stages: select confirmed bookings, total their duration and report remaining capacity.

    Recommended first: Modern JavaScript

    • 3 lessons
    • About 1 hour