{ Class Syntax. }

Objectives:

Class syntax

Although this addition to the language is not widely loved by the community, it is important to understand because modern frameworks like React and Angular 2 use it quite frequently. All that this syntax does is obfuscate constructor functions and prototype properties/methods. There is nothing new going on here; it is just a layer of abstraction. Let's recall what this looked like in ES5:

The function called constructor MUST be named that way (since that is what is run when the new keyword is used). If you just try to run Person() you will get a TypeError with the message that "Class constructor Person cannot be invoked without 'new'".

If we want to add functions directly on the "class" (which is really a function), we use the word static.

You can read more about this new class syntax here, and you can read more about the static keyword here.