Reset an Inherited Constructor Property

Когда объект наследует свой prototype от другого объекта, он также наследует свойство конструктора supertype . Вот пример:

function Bird () {}
Bird.prototype = Object.create (Animal.prototype);
let duck = new Bird ();
duck.constructor // function Animal () {...}
Но duck и все случаи Bird должны показать, что они были построены Bird а не Animal . Для этого, вы можете вручную установить Bird's свойство конструктора для Bird объекта:
Bird.prototype.constructor = Bird;
duck.constructor // function Bird () {...}

Fix the code so duck.constructor and beagle.constructor return their respective constructors.