ES6 Classes

Why classes?

JavaScript classes are simply syntactic sugar over existing JavaScript prototype chain. But classes give you a cleaner way to organise your code, and make it slightly easier for the beginner or people who are familar with class oriented languages to read JS and understand.

Readability

You don’t realise how messy Javascript is until you work on a large-scale project comprised of more than two developers, ES6 classes come with all of the benefits of pre-existing prototypical inheritance, but require less typing and they make your code easier to understand and resemble closely an object-oriented programming language like Java and its approach to classes.

There are plans to introduce object-oriented syntax like; static, public, private in ES7, but we’ll wait and see if they make the cut.

Better IDE Support

When coupled with a strong IDE and tooling, ES6 classes can be powerful in that they can be analysed by the IDE and we are given more options for tracing methods (especially when extending parent classes). Webstorm supports classes quite well when used with ES6.