1、Object.getPrototypeOf(obj)
该方法返回 obj 对象的原型对象,等同于 obj.__proto__
function Person(){ ?this.name = ‘jack‘}let man = new Person();console.log(Object.getPrototypeOf(man) === Person.prototype); ??//trueconsole.log(Object.getPrototypeOf(man) === man.__proto__); //true
JS中Object的一些关于原型的方法
原文地址:https://www.cnblogs.com/wenxuehai/p/10337389.html