Ecmascript 6 (scratchbook)

This page is mainly used for me to add notes on things I encounter while working with EcmaScript 6 in Chrome (48)


When working with EcmaScript 6 you can use classes. Classes are defined like so:

Really straight forward


Inheritance can be done like so



EcmaScript 6 suffers from the same issue with the This keyword as previous versions. So when you have a class in which you add a eventlistener on a node the this in that eventHandler will be the caller (window) and not the class instance

Easy solution (source)