javascript-language
Installation
SKILL.md
JavaScript Language Patterns
Priority: P0 (CRITICAL)
Implementation Guidelines
- Variables: const default. let if needed. No var — block scope only.
- Functionality: Use
Arrow Functionsfor callbacks/inlines;Function Declarationfor core logic. - Async Logic: Use async/await with try/catch and Promise.all() for parallel operations. ESM import/export only. No Callbacks — promisify everything.
- Modern Syntax: Use Destructuring, Spread (...), Optional Chain ?. and Nullish ?? coalescing.
- String Handling: Use
Template Literals(backticks) for interpolation and multi-line strings. - Data Collections: Prefer
map,filter, andreduceover imperativeforloops. - Modules: Standardize on ESM import/export; use Named Exports over Default.
- Encapsulation: Leverage
#privateclass fields for encapsulation. - Error States: Throw
new Error()with descriptive messages; never throw strings.