Before ES6, JavaScript does not really support classes and classical inheritance as the primary way of defining similar and related objects when it was created. This was very confusing back then, especially if you are coming from a C#, Java, C++ background. Moreover, the closest equivalent to a class before ES6 was creating a constructor-function and then assigning methods to the constructor’s prototype, an approach which typically called for creating a custom type.

However, today due to ES6, developers can now create their classes. We are going to tackle that in this article. Lastly, I still believe in more code samples to eventually learn the language even better, hence, we are going to focus more on the syntax to familiarize ourselves in this OOP core concepts.

Here are the following subjects that we are going to discuss and show some code samples.

  • Class creation
  • Class constructors
  • Class getters and setters
  • Class properties and static properties
  • Class methods and static methods
  • Inheritance
  • Inheriting constructors & properties
  • Inheriting methods

#javascript #es6 #oop

Object Oriented Programming JavaScript - ES6
9.55 GEEK