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.

Setup

nvm, fnm, node, npm, pnpm. Picking the right Node and bootstrapping a project.

Setup
Tooling

npm, pnpm, yarn, eslint, prettier, vitest, tsx, esbuild, vite. The modern toolchain.

Tooling
Snippets

Array / object reshaping, async one-shots, URL and Intl helpers.

Snippets

Language#

The spec building blocks in the order every language page on this handbook follows.

Syntax

//, /* */, ;, template literals, true false null undefined. Comments, identifiers, keywords, literals, statements vs expressions.

Syntax
Variables

let, const, var. Binding, block vs function scope, hoisting, the TDZ.

Variables
Types

number string bigint boolean null undefined symbol object, typeof, instanceof. Primitives, objects, coercion, equality.

Types
Operators

+ - * / % **, == === != !==, && || ??, ?:, ?., ..., & | ^ ~ << >> >>>. Arithmetic, equality, logical, nullish, spread, bitwise.

Operators
Controls

if else, switch, for of/in, while, do while, break continue return throw. Branching, loops, jumps.

Control flow
Functions

function, =>, return, yield, async, await. Parameters, closures, generators, async functions.

Functions
OOP

class, extends, super, #private, static, get/set, prototypes, this binding.

OOP

Patterns#

The layer above the spec. Idiomatic JavaScript and the patterns write by default.

Patterns

Destructuring, spread / rest, optional chaining, modules, iterators, generators, promise composition.

Patterns
Errors

try catch finally, throw, Error subclasses, AggregateError, async error flow, stack traces.

Errors

Data Structures#

The standard library’s container catalog.

Structures

Array Object Map Set WeakMap WeakSet, TypedArray, ArrayBuffer, DataView. Built-in containers.

Data Structures
Algorithms

sort, filter, map, reduce, find, flatMap, Array.from. The standard catalog on iterables.

Algorithms

I/O#

Talking to files, the network, the shell, and the host runtime.

I/O

fs/promises, readFile, writeFile, streams, console, process.stdin/stdout, JSON, Buffer.

I/O
CLI

process.argv, commander, yargs, process.exit, exit codes, stdin / stdout streaming.

CLI
Networking

fetch, http, https, net, tls, WebSocket, undici, ws. HTTP, sockets, TLS.

Networking
Concurrency

Event loop, Promise, async / await, worker_threads, cluster, AbortController.

Concurrency

Runtime#

The engine, the module system, and the layer between source and execution.

Runtime

import, export, ESM vs CommonJS, V8, Node, Deno, Bun, package.json, the event loop, garbage collection.

Runtime

Ecosystem#

npm and the third-party catalog the operator pulls in.

Libraries

Core: lodash, date-fns, zod, axios, undici. CLI: commander, chalk, ora, inquirer.

Libraries
Frameworks

Web: express, fastify, hono. UI: react, vue, svelte. Build: vite, next, astro.

Frameworks

Practice#

The disciplines that make scripts safe to ship and the end-to-end projects.

Testing

vitest, jest, mocha, playwright, msw. Unit, integration, e2e, mocks.

Testing
Projects

End-to-end JavaScript projects, a recon CLI, a browser-side OSINT scraper, a Node MCP server.

Projects