Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Writes, debugs, and refactors JavaScript code using modern ES2023+ features, async/await patterns, ESM module systems, and Node.js APIs. Use when building vanilla JavaScript applications, implementing Promise-based async flows, optimising browser or Node.js performance, working with Web Workers or Fetch API, or reviewing .js/.mjs/.cjs files for correctness and best practices.
| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-04 | ✗→✓ | ▲ Improved | -5% | 0% |
| case-05 | ✗→✓ | ▲ Improved | 29% | 0% |
| case-09 | ✗→✓ | ▲ Improved | -3% | 0% |
| case-13 | ✗→✓ | ▲ Improved | 15% | 0% |
| case-14 | ✗→✓ | ▲ Improved | 23% | 0% |
package.json, module system, Node version, browser targets; confirm .js/.mjs/.cjs conventionseslint --fix); if linter fails, fix all reported issues and re-run before proceeding. Check for memory leaks with DevTools or --inspect, verify bundle size; if leaks are found, resolve them before continuingLoad detailed guidance based on context:
| Topic | Reference | Load When | |-------|-----------|-----------| | Modern Syntax | references/modern-syntax.md | ES2023+ features, optional chaining, private fields | | Async Patterns | references/async-patterns.md | Promises, async/await, error handling, event loop | | Modules | references/modules.md | ESM vs CJS, dynamic imports, package.json exports | | Browser APIs | references/browser-apis.md | Fetch, Web Workers, Storage, IntersectionObserver | | Node Essentials | references/node-essentials.md | fs/promises, streams, EventEmitter, worker threads |
X | null or X | undefined patterns?.) and nullish coalescing (??)import/export) for new projectsvar (always use const or let)js// ✅ Correct — always handle async errors explicitly async function fetchUser(id) { try { const response = await fetch(`/api/users/${id}`); if (!response.ok) throw new Error(`HTTP ${response.status}`); return await response.json(); } catch (err) { console.error("fetchUser failed:", err); return null; } } // ❌ Incorrect — unhandled rejection, no null guard async function fetchUser(id) { const response = await fetch(`/api/users/${id}`); return response.json(); }
js// ✅ Correct const city = user?.address?.city ?? "Unknown"; // ❌ Incorrect — throws if address is undefined const city = user.address.city || "Unknown";
js// ✅ Correct — named exports, no default-only exports for libraries // utils/math.mjs export const add = (a, b) => a + b; export const multiply = (a, b) => a * b; // consumer.mjs import { add } from "./utils/math.mjs"; // ❌ Incorrect — mixing require() with ESM const { add } = require("./utils/math.mjs");
js// ✅ Correct const MAX_RETRIES = 3; let attempts = 0; // ❌ Incorrect var MAX_RETRIES = 3; var attempts = 0;
When implementing JavaScript features, provide:
Other measured skills in the registry, with their headline benchmark lift.