modern-javascript-patterns

Guide modern JavaScript ES6+ features, asynchronous patterns, and functional programming techniques.

1|Updated Jun 18, 2025
One-click install
npx skills add https://github.com/knopki/dotfiles --skill modern-javascript-patterns-knopki
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: modern-javascript-patterns
Source: https://github.com/knopki/dotfiles/tree/main/home/private_dot_config/opencode/skills/modern-javascript-patterns
Command: npx skills add https://github.com/knopki/dotfiles --skill modern-javascript-patterns-knopki

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill helps developers write cleaner, more efficient, and maintainable JavaScript code by leveraging modern ES6+ features and functional programming paradigms.

Core Features & Use Cases

  • ES6+ Syntax: Arrow functions, destructuring, spread/rest operators, template literals, enhanced object literals.
  • Asynchronous Programming: Promises, async/await for managing asynchronous operations.
  • Functional Programming: Array methods (map, filter, reduce), higher-order functions, immutability, pure functions.
  • Modern Class Features: Private fields, getters/setters, inheritance.
  • Modules: ES6 module system for code organization.
  • Iterators & Generators: For custom iteration and efficient data handling.
  • Operators: Optional chaining, nullish coalescing.
  • Performance: Debounce, throttle, lazy evaluation.

Quick Start

Explain the concept of destructuring in JavaScript with an example.

Frequently Asked Questions about modern-javascript-patterns

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I use async/await and promises for asynchronous programming in JavaScript?

Async/await and promises manage asynchronous operations in JavaScript by pausing execution until a promise resolves, allowing developers to write non-blocking code that reads sequentially. This Skill provides comprehensive guidance on implementing these asynchronous patterns effectively.

What are the best ways to apply functional programming with array methods in ES6+?

Functional programming in ES6+ utilizes array methods like map, filter, and reduce alongside higher-order functions to process collections immutably. This Skill explains how to implement pure functions and maintain immutability for cleaner, more maintainable JavaScript code.

How do I refactor legacy JavaScript code to use modern ES6+ features?

Refactoring legacy JavaScript to modern ES6+ involves replacing older syntax with destructuring, arrow functions, and spread/rest operators to improve readability and efficiency. This Skill offers comprehensive guidance on transitioning legacy applications to modern patterns.

When should I use optional chaining and nullish coalescing operators in JavaScript?

Optional chaining and nullish coalescing operators handle undefined or null values safely during property access and assignments in JavaScript. Use these modern operators to prevent runtime errors when accessing deeply nested object properties or setting default values.

How do I optimize JavaScript application performance using debounce and lazy evaluation?

Optimize JavaScript application performance using debounce and throttle to limit function execution frequency, and apply lazy evaluation to defer processing. This Skill details these performance optimization techniques to reduce unnecessary computations and improve responsiveness.