JavaScript Essentials
The programming language of the web: variables, functions, the DOM, arrays and objects, and fetching data from APIs.
Leads to: Software Developer, UI Developer, Mobile Developer, Web / Full-Stack Developer, Back-End Developer, QA / Test Engineer, Video Game Designer, Computer Science Teacher
Before you start
This course builds on HTML & CSS Foundations. Take it first if you are new to the topic.
About this course
JavaScript runs in every web browser and powers most interactive websites, as well as frameworks such as React and back ends built on Node.js. This beginner course takes you from your first variable to a page that loads live data. In four modules you learn the language fundamentals (variables, types, functions, conditionals and loops), how to change a web page and respond to clicks and key presses through the DOM, how to work with lists and records using array methods, objects and JSON, how to debug with the console and DevTools, and how to handle asynchronous work with promises, async/await, fetch and careful error handling. Every lesson has a reading with worked examples, free videos from reputable educators, a short quiz and an in-browser coding exercise that checks your work. You should know basic HTML and CSS first (see HTML & CSS Foundations). By the end you will have built a quote picker, a to-do list and a page that renders data from an API.
Course content
Module 1
Language Fundamentals
4 lessons · 2h 6mVariables, types, functions, conditionals and loops, and a first mini program.
- 37mVariables and typesReading
Store values with let and const, and learn the handful of types every JavaScript value belongs to.
- 36mFunctions in depthReading
Write reusable functions with parameters, default values and return values, and understand where variables are visible.
- 24mQuote of the DayReading
Combine an array and a few small functions into a mini program that picks and formats a quote.
- 29mConditionals and loopsReading
Make decisions with if/else and repeat work with for and while loops.
Module 2
Working with the DOM
3 lessons · 2h 13mSelect and change elements, respond to events, and build an interactive to-do list.
- 43mSelecting elementsReading
Find elements on a page with querySelector and change their text, classes and attributes.
- 39mEvent listenersReading
Make a page react to clicks and key presses with addEventListener.
- 51mBuild a to-do listReading
Combine selecting, creating and removing elements with event listeners to build a working to-do list.
Module 3
Arrays and Objects
3 lessons · 1h 56mTransform lists with array methods, model records as objects and JSON, and debug with the console.
- 36mArrays and array methodsReading
Transform lists of data with map, filter, reduce and their friends instead of hand-written loops.
- 54mObjects and JSONReading
Model real records as objects, and convert them to and from JSON text.
- 26mDebugging with the consoleReading
Find and fix bugs methodically with console logging, error messages and DevTools breakpoints.
Module 4
Asynchronous JavaScript
3 lessons · 2h 1mPromises and async/await, fetching data from APIs, and handling errors and edge cases.
- 43mCallbacks, promises, async/awaitReading
Understand why some work finishes later, and sequence it clearly with promises and async/await.
- 38mFetching data from an APIReading
Request JSON with fetch, check the response, and render the results to the page safely.
- 40mErrors and edge casesReading
Handle failures with try/catch, throw clear errors, and plan for empty, missing and invalid input.