We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
JavaScript深入之从原型到原型链, 讶羽 Javascript继承机制的设计思想,阮一峰 继承和原型链, MDN
构造函数 B ( ), 用 new 构建对象实例 b
function B(name) { this.name = name; // this 指向创建的实例对象,也就是b } var b = new B('b'); console.log(b.name) //b
函数
B.prototype === b.__proto__ //ture
原型
B.prototype.constructor === B //ture Object.getPrototypeOf(b) === B.prototype //ture
b.constructor === B.prototype.constructor //true
The text was updated successfully, but these errors were encountered:
Object.prototype === null 表示沿着原型链查找到此结束了~
Object.prototype === null
Sorry, something went wrong.
No branches or pull requests
JavaScript深入之从原型到原型链, 讶羽
Javascript继承机制的设计思想,阮一峰
继承和原型链, MDN
构造函数创建新对象实例
构造函数 B ( ), 用 new 构建对象实例 b
prototype
函数
都有一个 prototype 属性,是函数才有的属性函数
的 prototype 属性指向了一个对象,这个对象正是调用该构造函数而创建的实例的原型proto
constructor
原型
都有一个 constructor 属性指向关联的构造函数原型链(蓝色__proto__)
注意
原型
出获取了constructor属性The text was updated successfully, but these errors were encountered: