Modern JavaScript (ES2022+) patterns for clean, maintainable code.
Modern JavaScript standards for clean, maintainable code.
const default. let if needed. No var.async/await + try/catch...., Optional Chain ?., Nullish ??.${}.map, filter, reduce. No loops.import/export. Export only what is necessary.#private fields for true privacy.var: Block scope only.==: Strict ===.new Object(): Use literals {}.// Modern Syntax
const [x, ...rest] = items;
const name = user?.profile?.name ?? 'Guest';
// Async
async function getUser(id) {
try {
const res = await fetch(`/api/${id}`);
return res.json();
} catch (err) {
console.error(err);
throw err;
}
}
// Class + Private
class Service {
#key;
constructor(k) {
this.#key = k;
}
}For advanced patterns and functional programming: See references/REFERENCE.md.
best-practices | tooling
19a1140
If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.