The main principle with Object Oriented Programming (OOP) is the use of Classes (Functions in JavaScript) to create objects, and that objects are implemented in a manner that allows them to adopt Inheritance, Polymorphism, and Encapsulation. We are only concerned with Inheritance and Encapsulation, since only these are applicable for OOP in JavaScript. Essentially, objects can encapsulate functionalities and inherit methods and properties.
The rest of this article will focus on using objects in JavaScript in an object oriented manner—with inheritance and encapsulation—to easily reuse code in our applications and abstract functionalities away into specialized objects. We will focusonly on the best two techniques [1] for implementing OOP in JavaScript.
Your new post is loading...