One improvement may be to write dog.prototype = Object.create( pet.prototype ). Otherwise the constructor of the base class gets called two times. But I this is a really nice method ;)
One improvement may be to write dog.prototype = Object.create( pet.prototype ). Otherwise the constructor of the base class gets called two times. But I this is a really nice method ;)