There are some new features in ES6(ECMAScript 2015) like the following. But, we will focus on classes.
- Default parameter values
Class Declaration Syntax
Instance properties must be defined inside of class methods.
A class expression is another way to define a class.
The name of the getter/setter method cannot be the same as the name of the property.
Class with constructor and getter/setter
Private fields and functions are not support in ES6 yet. So, you can reach any fields declared in constructor like _firstName;
Computed Method Names
Inheritance(Sub classing with extends) and Overriding methods(Polymorphism)
Inheritance can be achieved with function declaration or function expression in ES5. So you should read the following posts as well.
draw() method is overrided. There is no keywords like virtual, override etc.
Mix-ins style multiple inheritance