> ## Documentation Index
> Fetch the complete documentation index at: https://mintlify.com/getify/You-Dont-Know-JS/llms.txt
> Use this file to discover all available pages before exploring further.

# Objects & Classes

> Explore JavaScript's object mechanism, prototypes, classes, and the this keyword in this comprehensive guide to objects and class-oriented design in JavaScript.

<Note>This book is currently marked as "work in progress" by the author.</Note>

# You Don't Know JS Yet: Objects & Classes

Welcome to the third book in the *You Don't Know JS Yet* series! This book explores one of JavaScript's three pillars: **the prototype**.

## What This Book Covers

Objects are the most important and varied value type in JavaScript. Every JS program you write will use them in one way or another. This book provides a complete understanding of:

* **Object Foundations** - How objects work as containers for multiple values
* **The Prototype Chain** - Understanding `[[Prototype]]` delegation and inheritance
* **Classes** - Modern `class` syntax and class-oriented design patterns
* **The `this` Keyword** - Mastering dynamic context binding
* **Delegation** - An alternative to class-oriented programming using prototypes

## Why Objects Matter

Objects aren't just containers - they're the foundation for the prototype system, one of JavaScript's three core pillars. Prototypes enable JS's class design pattern and power some of the most widely-used patterns in programming.

<CardGroup cols={2}>
  <Card title="Chapter 1: Object Foundations" icon="cube" href="/objects-classes/ch1">
    Learn how objects work as containers and master property access, assignment, and manipulation.
  </Card>

  <Card title="Chapter 2: How Objects Work" icon="gears" href="/objects-classes/ch2">
    Dive into property descriptors, the Metaobject Protocol, and the `[[Prototype]]` chain.
  </Card>

  <Card title="Chapter 3: Classy Objects" icon="diagram-project" href="/objects-classes/ch3">
    Master the `class` keyword, inheritance, static members, and private fields.
  </Card>

  <Card title="Chapter 4: This Works" icon="arrow-pointer" href="/objects-classes/ch4">
    Understand how `this` binding works and the four rules for `this` assignment.
  </Card>

  <Card title="Chapter 5: Delegation" icon="share-nodes" href="/objects-classes/ch5">
    Explore an alternative design pattern using prototypal delegation instead of classes.
  </Card>
</CardGroup>

## About the Second Edition

This is a complete rewrite of the first edition (titled "this & Object Prototypes"). Since ES6 introduced the `class` keyword in 2015, JavaScript has evolved significantly with 7+ yearly updates. This edition reflects JavaScript's current reality:

* Focus on modern `class` syntax rather than "prototypal classes"
* Coverage of ES2015+ features like private fields, static blocks, and more
* New organization starting with objects, building to prototypes, then classes
* Updated for ES2022 and beyond

<Warning>
  **Everything in JS is an object** is one of the most pervasive myths about JavaScript. This book will help you understand what's really true about objects, classes, and prototypes in JS.
</Warning>

## Prerequisites

Before diving into this book, you should have completed:

1. **Get Started** (Book 1) - Foundations of JavaScript
2. **Scope & Closures** (Book 2) - Understanding lexical scope

If you haven't read those yet, we encourage you to start there first.

## Start Learning

<Card title="Begin with Chapter 1" icon="rocket" href="/objects-classes/ch1">
  Start your journey into JavaScript objects and classes
</Card>
