Search⌘ K

JavaScript Classes and Object Creation

Explore JavaScript classes and object creation, including how to define properties and methods, use the 'this' keyword, and understand class inheritance. This lesson helps you build a solid foundation for React components by showing how JavaScript classes simplify prototypical inheritance and enable reusable code.

Background

Classes are relatively new to JavaScript as previously, there was only JavaScript’s prototype chain which could be used for inheritance too. JavaScript classes build up on top of the prototypical inheritance giving the whole thing a more straightforward representation. Classes in JavaScript are syntactical sugar over prototype chains. You don’t need to understand what a prototype chain or prototypical inheritance is for this course but knowing these concepts would give you some​ context of classes ...