Object Oriented Programming In JavaScript

JavaScript is considered as a prototype-based Object Oriented Programming language because it uses prototypal inheritance. It’s quite different than the classical OOP languages like Java. Initial version of JavaScript did not have a concept of a class. Functions used with new keyword turned into a constructor, which played a role of a class. When combined with the Object.create() function, JavaScript made prototypal inheritance possible.

The ES2015 JavaScript version introduced few new functions like Object.assign() and Object.setProtoTypeOf(). These functions introduced an easy way to compose objects by using Object Literals. ES2015 also introduced the class keyword. I guess to make all those Java folks more comfortable! Syntactically, JavaScript classes look like as if classical inheritance has finally arrived in JavaScript. However, under the hood it’s using the same function constructors and prototypal inheritance.

List of Articles on Object Oriented Programming In JavaScript

For more information about Object Oriented Programming in JavaScrip, read the following articles: