If you create a new object using Object.create and specify a prototype in it and make it a prototype constructor, the native constructor will not be overwritten. And if you simply make an object a prototype of a constructor, it will be overwritten. How does this removal occur? I do not understand the logic of rewriting the constructor. Or put the question. Why in the first case the designer did not overwrite, and in the second overwritten?
function Animal() {} function Rabbit() {} Rabbit.prototype = Object.create(Animal.prototype); var rabbit = new Rabbit(); alert( rabbit instanceof Rabbit ); выдаст true Rabbit.prototype = {}; alert( rabbit instanceof Rabbit ); выдаст false!