Glossary
Short definitions of the terms used across the topics. In Azerbaijani text, widely used English terms are kept as they are.
41 terms
A
- async/await
- Syntax built on promises. An async function always returns a promise; await pauses the function until the awaited value settles, and the rest of the function resumes as a microtask.
- automatic batching
- React groups several state updates into a single re-render. Since React 18 this also happens inside promises, timeouts and native event handlers.
C
- call stack
- The stack of function calls currently being executed. JavaScript always runs the frame on top of the stack, one at a time.
- callback
- A function passed to other code so that code can call it later — for example, when a timer fires or an event happens.
- closure
- A function together with the variables of the scope it was created in. The function keeps access to those variables even after the outer function has returned.
- compositing
- Combining separately painted layers into the final frame, usually on the GPU. Changes to transform and opacity can often be handled at this stage alone, skipping layout and paint.
- critical CSS
- The minimal CSS needed to render the content visible on first load (above the fold), often inlined into the HTML to avoid a render-blocking request.
- critical rendering path
- The sequence of steps the browser goes through to turn HTML, CSS and JavaScript into pixels on screen: DOM, CSSOM, render tree, layout and paint.
- CSSOM
- CSS Object Model — the browser's parsed representation of the page's stylesheets. It is combined with the DOM to compute each element's styles.
D
- debounce
- Delaying a function call until a set amount of time has passed without new calls, so only the last call in a burst runs.
- DOM
- Document Object Model — the tree of nodes the browser builds from HTML. JavaScript reads and changes the page through it.
E
- event loop
- The mechanism that lets single-threaded JavaScript run asynchronous code. When the call stack is empty, it takes the next task from a queue, runs it, and then runs all queued microtasks.
F
- First Contentful Paint (FCP)
- The time from the start of navigation until the browser first renders any text, image, SVG or non-white canvas.
- forced synchronous layout
- When JavaScript reads a geometry property (such as offsetHeight) after changing styles, the browser must compute layout immediately to return an up-to-date value.
G
- garbage collection
- Automatic memory management: the engine periodically frees objects that can no longer be reached from the program's roots (the global object, the call stack).
H
- higher-order function
- A function that takes another function as an argument or returns a function.
- hoisting
- Declarations are processed before the code in a scope runs. Function declarations can be called early, var is initialized to undefined, and let/const/class exist but stay uninitialized until their declaration runs.
- hydration
- Making server-rendered HTML interactive on the client: the framework attaches event handlers and state to the existing markup (in React, via hydrateRoot).
I
- IIFE
- Immediately Invoked Function Expression — a function expression that is called right where it is defined, typically to create a private scope.
L
- Largest Contentful Paint (LCP)
- A Core Web Vitals metric: the time until the largest image or text block visible in the viewport is rendered.
- layout (reflow)
- The step that calculates the exact size and position of every element. Recalculating it after a change is called reflow.
- layout thrashing
- Alternating style writes and layout reads in a loop, which forces many synchronous layouts within a single frame and makes the page slow.
- Lexical Environment
- In the ECMAScript spec, the structure (an Environment Record) that holds a scope's bindings plus a reference to its outer environment. A closure keeps this chain alive.
- lexical scope
- Scoping in which a variable's visibility is determined by where the code is written, not by where a function is called from.
M
- main thread
- The browser thread that runs a page's JavaScript and most of its rendering work (style, layout, paint). While it is busy, the page cannot respond to user input.
- memoization
- Caching a function's results by its arguments, so a repeated call with the same arguments returns the stored result instead of recomputing it.
- memory leak
- Memory that stays reachable — and therefore cannot be collected — even though the program no longer needs it.
- microtask
- A small job that runs as soon as the current task finishes and the call stack is empty — before the next task and before rendering. Promise reactions, queueMicrotask and MutationObserver callbacks are microtasks.
P
- paint
- The step that turns layout results into drawing instructions for text, colors, borders, shadows and images, usually for several layers. Doing it again after a visual change is a repaint.
- parser-blocking script
- A classic script without async or defer: the HTML parser stops, fetches the script if it is external, runs it, and only then continues parsing.
- preload scanner
- A secondary, lightweight parser that looks ahead in the HTML and starts downloading resources while the main parser is blocked.
- Promise
- An object that represents the eventual result of an asynchronous operation. It stays pending until it is either fulfilled with a value or rejected with a reason.
R
- render tree
- The tree of visible nodes with their computed styles, built by combining the DOM and the CSSOM. Elements with display: none are not part of it.
- render-blocking resource
- A resource the browser must finish loading before it renders the page. Stylesheets in the <head> are render-blocking by default.
- requestAnimationFrame
- A browser API that schedules a callback to run before the next repaint. It is the right place for visual updates and animations.
S
- scope
- The part of a program where a variable is visible and can be used. JavaScript has global, module, function and block scope.
- stale closure
- A closure that captured a value at one point in time (for example, during an earlier React render) and keeps using it after the value has changed.
T
- task queue
- A queue of tasks — timer callbacks, UI events, network events — waiting to run. The event loop takes one task per iteration. These tasks are often called macrotasks.
- temporal dead zone (TDZ)
- The time between entering a scope and the moment a let, const or class binding is initialized. Accessing the binding during this time throws a ReferenceError.
- throttle
- Limiting a function to run at most once per time interval, no matter how often it is triggered.
W
- Web APIs
- Interfaces the browser provides to JavaScript, such as setTimeout, fetch and DOM events. The browser does the work outside the call stack and queues a callback when the result is ready.