JavaScript

The language of the web, enabling interactive and dynamic content for virtually all websites.

Object-Oriented
Functional
Event-Driven
Beginner
1995
Brendan Eich

Overview

JavaScript is one of the core technologies of the World Wide Web, alongside HTML and CSS. As of 2024, 98.7% of websites use JavaScript on the client side for webpage behavior. All major web browsers have a dedicated JavaScript engine to execute the code on users' devices. With Node.js, JavaScript has also become a dominant force in server-side development.

Key Features

  • Ubiquitous — Runs in every browser, on servers (Node.js), mobile (React Native), and desktop (Electron)
  • Event-driven & asynchronous — Non-blocking I/O with promises and async/await
  • First-class functions — Functions are objects; enables powerful functional programming patterns
  • Prototype-based inheritance — Flexible object model without traditional classes (though class syntax exists)
  • Massive ecosystem — npm hosts over 2 million packages

Common Use Cases

  • Frontend Development — React, Vue, Angular, Svelte
  • Backend Development — Node.js, Express, Fastify, Hono
  • Mobile Apps — React Native, Ionic
  • Desktop Apps — Electron, Tauri (with JS frontend)
  • Tooling & Build Systems — Webpack, Vite, esbuild

Code Example

javascript
// Async data fetching with modern JavaScript
async function fetchUserData(userId) {
  try {
    const response = await fetch(`/api/users/${userId}`);
    const user = await response.json();
    return { ...user, fullName: `${user.first} ${user.last}` };
  } catch (error) {
    console.error('Failed to fetch user:', error);
    return null;
  }
}

Learning Resources

Learning Path

27 topics across 6 sections

1Basics

JavaScript fundamentals for the browser and beyond.

2Objects & Arrays

Working with JavaScript's core data structures.

  • Objects — Literals, property access, destructuring, computed keys, Object methods
  • Arrays — Methods (map, filter, reduce, find, some, every), spread, destructuring
  • JSON — Parsing, stringifying, and working with API responses
  • Maps & Sets — Map vs object, Set vs array, WeakMap, WeakRef

3Async Programming

Handling asynchronous operations in JavaScript.

  • Callbacks — Callback pattern, callback hell, and error-first convention
  • Promises — then/catch/finally, Promise.all, Promise.race, Promise.allSettled
  • Async/Await — Syntactic sugar for promises, error handling, and parallel execution
  • Event Loop — Call stack, task queue, microtasks, and how JS is single-threaded
  • Fetch API — HTTP requests, headers, responses, AbortController

4DOM & Browser APIs

Interacting with web pages and browser features.

  • DOM Manipulation — querySelector, createElement, event listeners, and delegation
  • Events — Event bubbling, capturing, preventDefault, and custom events
  • Web Storage — localStorage, sessionStorage, cookies, and IndexedDB
  • Canvas & Web APIs — Canvas 2D, Geolocation, Intersection Observer, Web Workers

5OOP & Patterns

Object-oriented programming and design patterns in JS.

  • Prototypes — Prototype chain, __proto__, Object.create, and inheritance
  • Classes — class syntax, constructor, extends, super, private fields (#)
  • Modules — ES modules (import/export), dynamic import(), and CommonJS
  • Design Patterns — Module, Observer, Factory, Singleton, and Proxy patterns

6Modern JavaScript

ES6+ features and advanced techniques.