Code Reference

Glossary

Javascript · Reference cheat sheet

Glossary

Javascript · Reference cheat sheet


📋 Overview

Alphabetical glossary of core JavaScript terms spanning values, functions, async flow, objects, and browser/runtime APIs.

🔧 Core concepts

TermDefinition
ArrayAn ordered, indexable collection of values with array methods.
Async/awaitSyntax that pauses an async function until a Promise settles.
BigIntAn integer type for values beyond Number.MAX_SAFE_INTEGER.
BooleanA primitive that is either true or false.
CallbackA function passed to another function to run later.
ClosureA function that retains access to variables from its outer scope.
CoercionAutomatic or explicit conversion of a value from one type to another.
DestructuringSyntax that unpacks values from arrays or properties from objects.
Event loopThe runtime mechanism that schedules macrotasks and microtasks.
FetchThe standard API for making HTTP requests that returns a Promise.
FunctionA callable object that executes a block of code with parameters.
GeneratorA function using function* and yield that produces an iterator.
HoistingMoving declarations to the top of their scope during compilation.
IIFEImmediately Invoked Function Expression that runs as soon as it is defined.
IterableAn object that implements [Symbol.iterator] and can be looped with for...of.
JSONA text data format and global object for parse/stringify.
MapA collection of key–value pairs that preserves insertion order.
ModuleA file with its own scope that exports and imports bindings.
NullA primitive representing intentional absence of an object value.
ObjectA collection of named properties; almost everything non-primitive is one.
Optional chainingThe ?. operator that short-circuits when a reference is nullish.
PromiseAn object representing a future success or failure of an async operation.
PrototypeThe object linked for inheritance lookups via the prototype chain.
ProxyAn object that intercepts fundamental operations on another object.
ScopeThe region of code where a binding is visible.
SetA collection of unique values.
SpreadThe ... syntax that expands iterables or object properties.
Strict modeA restricted JavaScript variant that catches silent errors.
SymbolA unique, immutable primitive often used as non-colliding property keys.
Template literalA string delimited by backticks that supports interpolation and multiline text.
ThisA binding whose value depends on how a function is called.
UndefinedA primitive meaning a variable has been declared but not assigned.
WeakMapA Map-like collection whose keys are weakly held objects.

💡 Examples

Closure and destructuring:

function makeCounter() {
  let n = 0;
  return () => ++n;
}
const { length } = [1, 2, 3];

Promise with async/await:

async function loadUser(id) {
  const res = await fetch(`/api/users/${id}`);
  if (!res.ok) throw new Error("failed");
  return res.json();
}

Optional chaining and nullish coalescing:

const name = user?.profile?.name ?? "Anonymous";

⚠️ Pitfalls

  • Confusing null (intentional empty) with undefined (missing value).
  • Mixing == coercion equality with === strict equality.
  • Assuming this always means the enclosing object — it depends on call style.
  • Treating Map like a plain Object — keys and iteration differ.
  • Equating callback hell with Promise chains — both are async, different control styles.

On this page