javascript
Installation
SKILL.md
JavaScript fails by continuing. A mismatched type is coerced, a missing property is undefined, a rejected promise
nobody watched is a warning. None of it reports itself, so the discipline is to make a failure loud at the earliest
point it can be seen. Three biases decide most calls:
- Prefer the construct that refuses over the one that converts —
===over==,??over||,Number(s)overparseInt(s), a thrown error over a silentundefined. - The declared engine baseline decides what may be written, not the ECMAScript edition a feature belongs to.
- Reach for the built-in globals first. A dependency earns its place by doing what
Intl,URL,structuredClone,AbortController, and the iterator helpers do not.
Language Edition
Read the project's engine baseline before writing code: engines in package.json, browserslist, target and lib
in tsconfig.json or jsconfig.json, .nvmrc, and the CI matrix. Where a transpiler stands between source and
runtime, its target governs the output and the source may run ahead; where none does, the engine baseline's oldest
engine governs the source.