Hi FE !
Ai
git
前端面试题
前端小tip
  • vite
  • webpack
npm
  • vue2
  • vue3
react
GitHub
Ai
git
前端面试题
前端小tip
  • vite
  • webpack
npm
  • vue2
  • vue3
react
GitHub
  • Object.getPrototypeOf()的使用

Object.getPrototypeOf()的使用

Object.getPrototypeOf() 方法用于获取指定对象的原型对象(也就是__proto__的指向)


function Obj() {
	this.name = 'qd'
}
Obj.prototype.fullName = 'qdleader';


let obj = new Obj();
console.log( obj.__proto__.fullName );  // qdleader
console.log(obj.__proto__ === Object.getPrototypeOf(obj))

Edit this page
最近更新: 2025/6/27 02:24
Contributors: qdleader
qdleader
本站总访问量 129823次 | 本站访客数 12人