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).