Tutorials
Short, focused articles on one idea at a time. Filter by level or type, or search for a topic.
-
Values and references: copying and mutation bugs
Why changing a copied object changes the original, comparing objects, and writing code that avoids accidental mutation.
-
Prototypes and inheritance
The prototype chain behind objects and classes, Object.create, and how property lookup works.
-
Installing PHP and running your first script
Get PHP 8 running on your computer, check the version, and run scripts from the terminal and PHP’s built-in web server.
-
The event loop, tasks and microtasks
How the call stack, task queue and microtask queue decide run order, with exercises.
-
PHP syntax: tags, statements, comments and echo
Learn PHP tags, statements and semicolons, comments, echo and print, and how PHP mixes with HTML.
-
Promise combinators: all, allSettled, race and any
Coordinate several promises, handle partial failure, and set timeouts with race.
-
Creating, inserting and removing DOM elements
Build elements with createElement, insert them with append and before, use template elements, and remove nodes.
-
Event bubbling, capturing and delegation
How events travel through the DOM, stopping propagation, and handling many elements with one listener.
-
Callbacks and asynchronous code
Why JavaScript is asynchronous, callback functions, and the problems that led to promises.
-
Promises
Create and consume promises, chaining with then, error handling with catch, and finally.
-
async and await
Write asynchronous code that reads top to bottom, handle errors with try and catch, and run tasks in parallel.
-
Fetching data with fetch()
Request JSON from an API with fetch, check response status, and show loading and error states.
-
Debugging with the console and DevTools
Read error messages, log effectively, set breakpoints and step through code in browser DevTools.
-
ES modules: import and export
Split code into modules with named and default exports, use modules in the browser, and dynamic import.
-
Scope, hoisting and the temporal dead zone
Global, function and block scope, hoisting of declarations, and why let and const throw before declaration.
-
Error handling: try, catch, finally and custom errors
Throw and catch errors, error types, custom error classes, and handling async errors.
-
Closures
How functions remember their surrounding scope, practical uses, and common closure bugs.
-
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.