我没有正确地把这个放到我的头上。我看到了一个与之相关的问题,但却无法从中得到任何答案。是在constructor.prototype!= __。proto .__ in javascript?
function Shane(){}
var sha = new Shane();
console.log(sha.__proto.__.__proto.__.__proto.__) //null
console.log(sha.constructor.prototype.constructor.prototype.
constructor.prototype)
//Shane [Can anyone explain me what5 is happening here]
- 是
constructor.prototype != .__proto.__
? - 为什么我们有两种方法知道
prototype
链?
'sha .__ proto__ === Shane.prototype',但'Shane.prototype!== Shane.constructor.prototype'因此..(从那里开始;也如所示,将抛出一个TypeError - 未定义的异常。) – user2864740 2015-02-17 22:24:46
@ user2864740想说:'sha .__ proto__ === Shane.prototype'但是'Shane.prototype .__ proto__!== Shane.prototype.constructor.prototype'! – Bergi 2015-02-17 23:31:59
@Bergi这不是重复的。问题实际上是关于原型的构造函数。 – freakish 2015-02-17 23:40:33