原型链 - DeepSeek
原型(Prototype)
构造函数(Constructor)
function Person(name) {
this.name = name;
}
Person.prototype.sayHello = function() {
console.log(`Hello, my name is ${this.name}`);
};
const person = new Person('Alice');
person.sayHello(); // 输出: Hello, my name is Aliceprototype 属性
原型链(Prototype Chain)
Object.prototype
Object.prototype继承
instanceof 和 isPrototypeOf
instanceof 和 isPrototypeOf总结
案例 - 浏览器环境navigator分析

思考:navigator对象的原型对象是谁?
Last updated