Why are you talking all these nonsense? . . . . That is to say, the position of an object in the prototype chain depends entirely on the function. This is the only thing that comes to my mind that may be correct. The prototype chain is actually composed of theprototype属性构成的链表,一个对象通过原型链继承其他的属性。可能因为这是一个构造函数的prototypeattribute of the function, so that's what he said. But this is really not necessarily right, for example
function fn(){} function fn2(){} fn2.prototype=fn.prototype; a = new fn(); fn.prototype = {}; console.log(a instanceof fn) // false console.log(a instanceof fn2) // true
About the prototype chain, take a look at this: http://zonxin.github.io/post/...
Why are you talking all these nonsense? . . . . That is to say, the position of an object in the prototype chain depends entirely on the function. This is the only thing that comes to my mind that may be correct. The prototype chain is actually composed of the
prototype
属性构成的链表,一个对象通过原型链继承其他的属性。可能因为这是一个构造函数的prototype
attribute of the function, so that's what he said. But this is really not necessarily right, for exampleAbout the prototype chain, take a look at this: http://zonxin.github.io/post/...