Last updated: August 27, 2026.
JavaScript adds behavior, data processing, and interaction to web pages. Use this guide to learn the language fundamentals and find focused examples for common browser tasks.
Start with the language basics
- What JavaScript is and where it runs
- Write your first JavaScript
- Variables,
const,let, and scope - Arrays and functions
- Loops and iteration
- Conditional statements
A small working example
const prices = [12.5, 8, 19.99];
const total = prices.reduce((sum, price) => sum + price, 0);
console.log(total.toFixed(2));This example combines an array, an arrow function, and reduce() to calculate a total.
Browser tasks
For a complete language reference, use the MDN JavaScript Guide.