Skip to main content
This book is currently marked as “work in progress” by the author.

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.

Chapter 1: Object Foundations

Learn how objects work as containers and master property access, assignment, and manipulation.

Chapter 2: How Objects Work

Dive into property descriptors, the Metaobject Protocol, and the [[Prototype]] chain.

Chapter 3: Classy Objects

Master the class keyword, inheritance, static members, and private fields.

Chapter 4: This Works

Understand how this binding works and the four rules for this assignment.

Chapter 5: Delegation

Explore an alternative design pattern using prototypal delegation instead of classes.

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
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.

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

Begin with Chapter 1

Start your journey into JavaScript objects and classes

Build docs developers (and LLMs) love