Skills · Coding

Modern Javascript Patterns

Unverified30/40

Master ES6+ features including async/await, destructuring, spread operators, arrow functions, promises, modules, iterators, generators, and functional programming patterns for writing clean, efficient JavaScript code. Use when refactoring legacy code, implementing modern patterns, or optimizing JavaScript applications.

Originally by wshobson · MIT

Claude CodePartialHas SKILL.md but declares no allowed-tools — Claude Code will ask for permission each time
CursorPartialPlain prose you can paste in — but no Cursor rules file
CodexPartialPlain prose you can paste in — but no AGENTS.md
Gemini CLIPartialPlain prose you can paste in
CopilotPartialPlain prose you can paste in — but no Copilot instructions file
npx agentalley add modern-javascript-patterns

This command does not work yet — the CLI is still being built. Until then, use Raw in the reader below to take the file.

Who is stuck, and on what

Master ES6+ features including async/await, destructuring, spread operators, arrow functions, promises, modules, iterators, generators, and functional programming patterns for writing clean, efficient JavaScript code. Use when refactoring legacy code, implementing modern patterns, or optimizing JavaScript applications.

The whole source

No sign-in, no blur, nothing truncated
modern-javascript-patterns/SKILL.md44 lines2.1 KBRawView on GitHub
Frontmatter — 2 properties
namemodern-javascript-patterns
descriptionMaster ES6+ features including async/await, destructuring, spread operators, arrow functions, promises, modules, iterators, generators, and functional programming patterns for writing clean, efficient JavaScript code. Use when refactoring legacy code, implementing modern patterns, or optimizing JavaScript applications.
1---
2name: modern-javascript-patterns
3description: Master ES6+ features including async/await, destructuring, spread operators, arrow functions, promises, modules, iterators, generators, and functional programming patterns for writing clean, efficient JavaScript code. Use when refactoring legacy code, implementing modern patterns, or optimizing JavaScript applications.
4---A5No allowed-tools declared — no way to tell what this skill may touch
5 
6# Modern JavaScript Patterns
7 
8Comprehensive guide for mastering modern JavaScript (ES6+) features, functional programming patterns, and best practices for writing clean, maintainable, and performant code.
9 
10## When to Use This Skill
11 
12- Refactoring legacy JavaScript to modern syntax
13- Implementing functional programming patterns
14- Optimizing JavaScript performance
15- Writing maintainable and readable code
16- Working with asynchronous operations
17- Building modern web applications
18- Migrating from callbacks to Promises/async-await
19- Implementing data transformation pipelines
20 
21## Detailed patterns and worked examples
22 
23Detailed pattern documentation lives in `references/details.md`. Read that file when the navigation tier above is insufficient.
24 
25## Best Practices
26 
271. **Use const by default**: Only use let when reassignment is needed
282. **Prefer arrow functions**: Especially for callbacks
293. **Use template literals**: Instead of string concatenation
304. **Destructure objects and arrays**: For cleaner code
315. **Use async/await**: Instead of Promise chains
326. **Avoid mutating data**: Use spread operator and array methods
337. **Use optional chaining**: Prevent "Cannot read property of undefined"
348. **Use nullish coalescing**: For default values
359. **Prefer array methods**: Over traditional loops
3610. **Use modules**: For better code organization
3711. **Write pure functions**: Easier to test and reason about
3812. **Use meaningful variable names**: Self-documenting code
3913. **Keep functions small**: Single responsibility principle
4014. **Handle errors properly**: Use try/catch with async/await
4115. **Use strict mode**: `'use strict'` for better error catching
42 
43For common pitfalls (this binding, promise anti-patterns, memory leaks), see [references/advanced-patterns.md](references/advanced-patterns.md).
44 

Reviews

Installed this one?Write the first review and take the Trailblazer badge.

Reviews only open after a real install, so this is empty — and we leave it empty rather than invent one.

Alternatives

Also in Coding