JavaScript
🏛️ Object-oriented programming
Model the world with objects, classes, inheritance and encapsulation.
What you'll learn
- Create classes with a
constructorand methods, and instantiate them withnew. - Implement inheritance with
extendsandsuper, and encapsulate state with private fields#, getters and setters. - Predict and control the value of
thisusingbind,callandapply, and avoid losing it in callbacks. - Define static members and private methods to distinguish what belongs to the class from what is internal.
Lessons
Objects and thisGrouping data and behavior; the this keyword. Classes, constructor and methodsTemplates to create many identical objects. Inheritance and encapsulationextends, super, private fields, getters and setters. Dynamic this: bind, call and applyControl which object this points to and avoid losing this. Static members and private methodsstatic for the class; #method() and #field for what is internal.Practice this module in the app
DevPath is a hands-on course: you read the theory here; in the app you put it into practice with exercises that really run, offline.
Start free in the app →