JavaScript Classes Guide
ES6 classes provide syntactic sugar over JavaScript's prototype-based inheritance. They make it easier to create objects with shared behavior. The guide walks through Class Syntax, Inheritance, Static Members. Classes are defined with `class Name {}`. The `constructor()` method initializes new instances. Methods are defined without `function` keyword. Classes are not hoisted and must be declared before use. `extends` establishes inheritance between classes. `super()` calls the parent constructor. `super.methodName()` calls parent methods. Child classes can override parent methods while still accessing them via `super`. The guide is organized into 3 sections that build on each other, each pairing a prose explanation with runnable code. Browse the individual methods covered by this guide in the Classes category. Key APIs covered include class, constructor(), extends, super(), static, new.target. Related guides: Arrays, Strings, Numbers, Math, Date. This is one of 145 JavaScript guides on JS Reference — see the full list on the guides page.