| name | javascript |
| description | JavaScript ES6+ programming including async/await, DOM manipulation, modules, and Node.js. Use for .js files and web development. |
JavaScript
Modern JavaScript development with ES6+ features, async patterns, and best practices.
When to Use
- Working with
.js files in web or Node.js projects
- Implementing async/await patterns and promises
- DOM manipulation and event handling
- Building frontend applications
Quick Start
async function fetchData(url) {
try {
const response = await fetch(url);
if (!response.ok) throw new Error(`HTTP ${response.status}`);
return await response.json();
} catch (error) {
console.error("Fetch failed:", error);
throw error;
}
}
Core Concepts
Destructuring & Spread
{ name, age = , ...rest } = user;
[first, second, ...remaining] = items;
updated = { ...user, : };
combined = [...array1, ...array2];