Before getting started on the EventEmitter class, we need to take a look at another of the ES2015 features: classes. The JavaScript language has always had objects, and a concept of a class hierarchy, but nothing so formal as in other languages. The ES2015 class object builds on the existing prototype-based inheritance model, but with a syntax looking very much like class definitions in other languages.
For example, consider this class we'll be using later in the book:
class Note { constructor(key, title, body) { this._key = key; this._title = title; this._body = body; } get key() { return this._key; } get title() { return this._title; } set title(newTitle) { return this._title = newTitle; } get body() ...