Class inheritance in javascript (ecmascript 5, ecmascript 6)