Module Overview
Object-Oriented Programming
As programs grow, grouping related data and the behavior that acts on it keeps them manageable. This module covers object-oriented programming in JavaScript: how objects and prototypes work underneath, and how classes give you a cleaner way to write the same thing.
Why This Matters
You’ve already been using objects since Module 5. This module teaches you to design your own reusable “blueprints” for objects, which is how most real-world JavaScript code, including the libraries you’ll eventually use, is actually organized.
What You’ll Learn
- The
thiskeyword: how its value depends on how a function is called, not where it’s written - Objects and prototypes: what’s actually happening underneath a class
- Writing your own classes and constructors
- Encapsulation: keeping an object’s internal details separate from what it exposes
- Inheritance, for building a class on top of another
- Polymorphism, static methods, and private fields
Outcome
By the end of this module, you’ll be able to design and write your own classes instead of representing everything as loose functions and separate data, and you’ll understand exactly what this refers to instead of guessing.
Let’s get started.