articles / Glossary

Glossary

Short, plain definitions for the terms that come up most often across the articles. The goal is a fast, jargon-free refresher rather than a textbook: each entry is one or two sentences, enough to recognise the idea and move on. Where a term has a full write-up elsewhere on the site, the relevant article goes deeper.

JavaScript has accumulated a lot of vocabulary over the years, some of it genuinely useful and some of it interview trivia. The terms collected here are the ones that actually change how you read and write code day to day, from the way the runtime schedules work to the patterns that show up in almost every codebase. If a definition raises more questions than it answers, that usually means the topic deserves a full article, and most of these do.

Async function
A function declared with async that always returns a promise and may use await inside it to pause for asynchronous work without blocking the thread.
Call stack
The structure that tracks which functions are currently running; a function is pushed on when called and popped off when it returns.
Coercion
JavaScript’s automatic conversion of a value from one type to another, for example a number to a string when concatenating.
Immutable update
Producing a new value instead of changing an existing one in place, which makes change easier to track and reason about.
Memoization
Caching a function’s result for a given input so repeat calls with the same input return instantly.
Mutation
Changing an existing object or array in place rather than creating a new one; a frequent source of hard-to-trace bugs.
Pure function
A function whose output depends only on its inputs and which causes no side effects, making it predictable and easy to test.
Race condition
A bug where the result depends on the unpredictable order in which asynchronous operations finish.
Side effect
Anything a function does beyond returning a value, such as writing to the DOM, logging, or making a network request.
Tree (DOM tree)
The nested, parent-and-child structure of elements that makes up a page and that scripts traverse and modify.
AbortController
An object that produces a signal you can pass to fetch and other APIs to cancel an in-progress operation on demand.
Curry
Transforming a function so it takes its arguments one at a time, each call returning a function that expects the next.
Event bubbling
The way an event fires on the target element and then propagates up through its ancestors, which is what makes event delegation possible.
Generator
A function declared with function* that can pause and resume with yield, producing a sequence of values lazily.
Idempotent
An operation that produces the same result whether it runs once or many times, an important property for safe retries.
Lexical scope
The rule that a function can access variables from the place it was written, which is what makes closures work.
NaN
“Not a Number”, the result of an invalid numeric operation; notably it is not equal to itself, so test with Number.isNaN.
Nullish coalescing
The ?? operator, which falls back to a default only when the left side is null or undefined, not for any falsy value.
Optional chaining
The ?. operator, which short-circuits to undefined instead of throwing when an intermediate value is null or undefined.
Truthy / falsy
How a value behaves in a boolean context; the falsy values are false, 0, empty string, null, undefined and NaN, and everything else is truthy.
Arrow function
A compact function syntax that does not bind its own this; it uses the value from the surrounding scope.
Bundler
A tool that resolves the import graph and combines many modules into a few optimized files for the browser.
Callback
A function passed to another function to be called later, often when an asynchronous operation finishes.
Closure
A function together with the variables it captured from the scope where it was defined, which stay available after that scope returns.
CommonJS
Node’s original module system using require() and module.exports; loads synchronously at run time.
CORS
Cross-Origin Resource Sharing: the rules that decide whether a page may read a response from a different origin.
Debounce
Delaying a function until input stops for a set time, so it runs once after a burst rather than on every event.
Destructuring
Syntax that pulls values out of arrays or objects into variables in one step.
DOM
The Document Object Model: the live, in-memory tree of the page that scripts read and change.
ESM
ECMAScript Modules: the language’s built-in module system using import and export.
Event delegation
Attaching one listener to a parent element and inspecting the event target, instead of one listener per child.
Event loop
The mechanism that runs queued callbacks on the single thread whenever the call stack is empty.
Hoisting
The way function and var declarations are processed before code runs; let and const are not usable before their line.
Microtask
A high-priority queued job, such as a promise reaction, drained fully before the next ordinary task.
Polyfill
Code that supplies a standard feature to an environment that lacks it, so modern code runs on older browsers.
Promise
An object representing a value that will be available later, with then, catch, and finally.
Prototype
The object another object links to; property lookups that miss continue along this chain.
Source map
A file mapping built or minified output back to the original source so devtools shows readable code.
Spread
The ... syntax that expands an array or object, used for copying and merging.
this
A keyword whose value depends on how a function is called, not where it is defined.
Throttle
Limiting a function to run at most once per interval during continuous events such as scrolling.
Transpiler
A tool that rewrites newer syntax into an older equivalent so it runs in environments that lack the new feature.
Tree-shaking
Dropping code that is never imported during bundling; most effective with named ES module exports.
UUID
A 128-bit identifier; version 4 is generated from random data and is effectively unique in practice.