Radoslav Popov

Classical OOP in JavaScript

There are two ways to look at the Object-oriented programming when it comes to JavaScript. The first one is to think in terms of classes and instances (the classical OOP), and the second one - only in terms of objects (the prototypal OOP).

In this article I've made an attempt to explain the classical OOP paradigm using a lot of examples (the most of them influenced by the Pro JavaScript Design Patterns book). How can you make a class, public and private members, static and instance methods, and how can you emulate inheritance?