JS

JavaScript Tutorial

Make pages interactive – variables, functions, arrays, objects, the DOM, events and fetch.

JavaScript makes web pages interactive. In this track you learn the language step by step – values, conditions, loops, functions, arrays and objects – and then use it to change the page with the DOM, react to clicks and keys with events, and load data with fetch.

All examples run in your browser, so you can experiment as you read.

  1. 1 JavaScript IntroductionLearn what JavaScript is, what it can do in a web page, and how to add your first script to…
  2. 2 JavaScript Variables and Data TypesStore values with let and const, understand why var is legacy, and learn the data types JavaScript uses: strings, numbers,…
  3. 3 JavaScript OperatorsDo maths, compare values and combine conditions with JavaScript operators – including why === is safer than ==.
  4. 4 JavaScript Conditions: if, else and switchMake decisions in JavaScript with if, else if, else, switch and the ternary operator, and learn which values count as…
  5. 5 JavaScript Loops: for, while and for…ofRepeat code without copy-pasting: learn for, while, do...while and for...of loops, plus break and continue, with runnable examples.
  6. 6 JavaScript FunctionsWrite reusable code with JavaScript functions: parameters, return values, default values, arrow functions and scope, explained for beginners.
  7. 7 JavaScript ArraysStore lists of values in JavaScript arrays and work with them using push, includes, slice, map, filter, find and reduce.
  8. 8 JavaScript ObjectsGroup related data with JavaScript objects: properties, methods, dot and bracket notation, looping over keys, arrays of objects and JSON.
  9. 9 JavaScript DOM ManipulationUse the DOM to find elements, change their text, classes and attributes, and create or remove elements with JavaScript.
  10. 10 JavaScript EventsRespond to clicks, typing and form submissions with addEventListener, the event object, preventDefault and event delegation.
  11. 11 Modern JavaScript (ES6+) FeaturesThe modern JavaScript features you will use daily: template literals, destructuring, spread and rest, optional chaining, ?? and modules.
  12. 12 Fetch and Async JavaScriptUnderstand asynchronous JavaScript – Promises, async/await and error handling – and load JSON data from a server with fetch().