将子原型设置为父级的实例
function Animal() { }
Animal.prototype = {
constructor: Animal,
eat: function() {
console.log("nom nom nom");
}
};
function Dog() { }
// Add your code below this line
let beagle = new Dog();
Dog.prototype = Object.create(Animal.prototype);
// 应该打印出 "nom nom nom"