JavaScript#
JavaScript is the operator’s universal client-side language and a serious server-side language through Node.js, Deno, and Bun. Dynamically typed, prototype-based, multi-paradigm, with the largest deployed runtime surface of any language (every browser, every embedded engine, every serverless runtime).
For the operator, JavaScript shows up in three places: the browser-side payload (XSS, DOM tradecraft, client-side recon), Node-based tooling and CLI utilities, and the implant layer inside Electron, VS Code, and most modern desktop apps.
Baseline. ES2022+ syntax (top-level await, #private
fields, ??, ?., logical assignments) is assumed. Node 20+
is the reference runtime; recipes work in Deno and Bun unless
called out inline.
Default toolchain. node (or deno / bun) as the
runtime, npm / pnpm / yarn for packages, eslint
and prettier for lint / format, vitest or jest for
tests.
Setup#
Picking the runtime and getting the toolchain on the host.
nvm, fnm, node, npm, pnpm. Picking
the right Node and bootstrapping a project.
npm, pnpm, yarn, eslint, prettier,
vitest, tsx, esbuild, vite. The modern
toolchain.
Array / object reshaping, async one-shots, URL and
Intl helpers.
Language#
The spec building blocks in the order every language page on this handbook follows.
//, /* */, ;, template literals,
true false null undefined. Comments, identifiers,
keywords, literals, statements vs expressions.
let, const, var. Binding, block vs function
scope, hoisting, the TDZ.
number string bigint boolean null undefined symbol
object, typeof, instanceof. Primitives,
objects, coercion, equality.
+ - * / % **, == === != !==, && || ??,
?:, ?., ..., & | ^ ~ << >> >>>.
Arithmetic, equality, logical, nullish, spread, bitwise.
if else, switch, for of/in, while,
do while, break continue return throw. Branching,
loops, jumps.
function, =>, return, yield, async,
await. Parameters, closures, generators, async
functions.
class, extends, super, #private,
static, get/set, prototypes, this
binding.
Patterns#
The layer above the spec. Idiomatic JavaScript and the patterns write by default.
Destructuring, spread / rest, optional chaining, modules, iterators, generators, promise composition.
try catch finally, throw, Error subclasses,
AggregateError, async error flow, stack traces.
Data Structures#
The standard library’s container catalog.
Array Object Map Set WeakMap WeakSet,
TypedArray, ArrayBuffer, DataView. Built-in
containers.
sort, filter, map, reduce, find,
flatMap, Array.from. The standard catalog on
iterables.
I/O#
Talking to files, the network, the shell, and the host runtime.
fs/promises, readFile, writeFile, streams,
console, process.stdin/stdout, JSON,
Buffer.
process.argv, commander, yargs,
process.exit, exit codes, stdin / stdout streaming.
fetch, http, https, net, tls,
WebSocket, undici, ws. HTTP, sockets, TLS.
Event loop, Promise, async / await,
worker_threads, cluster, AbortController.
Runtime#
The engine, the module system, and the layer between source and execution.
import, export, ESM vs CommonJS, V8, Node, Deno,
Bun, package.json, the event loop, garbage
collection.
Ecosystem#
npm and the third-party catalog the operator pulls in.
Core: lodash, date-fns, zod, axios,
undici. CLI: commander, chalk, ora,
inquirer.
Web: express, fastify, hono. UI:
react, vue, svelte. Build: vite,
next, astro.
Practice#
The disciplines that make scripts safe to ship and the end-to-end projects.
vitest, jest, mocha, playwright,
msw. Unit, integration, e2e, mocks.
End-to-end JavaScript projects, a recon CLI, a browser-side OSINT scraper, a Node MCP server.