Early previewThis guide is in development. Items tagged verify are still being checked against official docs.
nebx Learn
GitHub
Menu
Home/JavaScript/Best practices
JS

JavaScript

The language of the web, on the client, the server and the edge.

Paradigm
Multi-paradigm, prototype-based, functional
Typing
Dynamic, weak (TypeScript adds static types)
Memory
Garbage collected
Runs
V8 / SpiderMonkey / JSC engines (JIT)
Concurrency
Single-threaded event loop, workers

Best practices

Habits experienced JavaScript teams agree on.

Add types

Use TypeScript, or JSDoc with type checking, to catch errors before runtime.

const by default, let when needed, never var

Block scoping avoids hoisting surprises.

Strict equality

Use === and !==; == applies coercion rules few people remember.

Lint and format automatically

ESLint plus Prettier (or Biome) in the editor and CI.

Handle every rejection

await inside try/catch, or attach .catch; unhandled rejections crash modern Node.js.

Saved in this browser only. Part of Clean code foundations (0/5).