Easy JavaScript Part 10: Class in JavaScript?

ECMAScript 6 introduced the class keyword to create classes in JavaScript. Now, you can just use the class attribute to create a class in JavaScript. Before ECMA 6, whenever you called a function using a new operator, the function returned a new object. Therefore, the function was acting as a class and known as a constructor. This way of calling a function to return an object is also known as the Constructor Invocation Pattern.
But in ECMAScript 6, a class can be created using the class keyword. Consider the code below:

Link: https://dzone.com/articles/easy-javascript-part-10-class-in-javascript?utm_medium=feed&utm_source=feedpress.me&utm_campaign=Feed%3A+dzone%2Fwebdev