Tutorial
-
Classes
Class syntax, constructors, methods, private fields, static members and extends.
-
The this keyword
How this is decided at call time, in methods, callbacks, arrow functions and with bind, call and apply.
-
Array methods: map, filter, reduce, find and more
Transform and search arrays with built-in methods, chaining, and which methods mutate.
-
Destructuring, spread and rest
Unpack arrays and objects, copy and merge with spread, and collect arguments with rest.
-
Working with objects: keys, entries, copying and freezing
Object.keys, values and entries, shallow versus deep copies with structuredClone, and Object.freeze.
-
Loops: for, while, for…of and for…in
Repeat work with each loop type, break and continue, and which loop suits arrays and objects.
-
Functions: declarations, parameters and return values
Define and call functions, default parameters, return values and function expressions.
-
Arrow functions
Arrow function syntax, implicit returns, and how arrows differ from regular functions.
-
Arrays: creating, reading and updating
Create arrays, read and change elements, add and remove items, and check length.
-
Objects: properties, methods and dot notation
Create objects, read and update properties, methods, and bracket notation for dynamic keys.
-
Selecting elements in the DOM
What the DOM is, and selecting elements with querySelector, querySelectorAll and getElementById.
-
Reusable markup with template and slot
The template element and slots as the HTML foundation for Web Components.
-
Changing content, attributes and classes
Update text, attributes, classes and styles safely, and why textContent beats innerHTML for user data.
-
Loading performance in HTML: preload, preconnect, async and defer
Control how the browser fetches resources with resource hints and script loading attributes.
-
Handling events with addEventListener
Listen for clicks, input and keyboard events, the event object, and preventDefault.
-
What is JavaScript?
What JavaScript does in the browser and on servers, how it relates to HTML and CSS, and what ECMAScript means.
-
Working with forms in JavaScript
Read form values, handle submit, give live validation feedback and send data without a page reload.
-
Running JavaScript: the console, script tags and Node.js
Run code in the browser console, load scripts with the script element and defer, and run files with Node.js.
-
Variables: let, const and var
Declare variables with let and const, why var is avoided, and naming conventions.
-
Data types and typeof
Primitive types, objects, null versus undefined, and checking types with typeof.