一.
Object.getPrototypeOf(对象)
推荐使用第一种方法
二.
构造函数.prototype
三.
对象.__proto__
例
function Cat(name,color) {
this.name = name
this.color = color
this.f = function () {
console.log(this.name,this.color)
}
}
let cat1 = new Cat('波斯猫','黑色')
let a = Object.getPrototypeOf(cat1)
let b = Cat.prototype
let c = cat1.__proto__
console.log(a)
console.log(b)
console.log(c)
console.log(a===b) //true
console.log(a===c) //true
console.log(b===c) //true