App下載

JavaScript 原型、構(gòu)造函數(shù)及實例例之 間的關(guān)系?

萌夠才回家 2021-12-15 15:03:30 瀏覽數(shù) (2364)
反饋


實例例._proto_ === 原型
實例例.constructor === 構(gòu)造函數(shù)
原型.constructor === 構(gòu)造函數(shù)
構(gòu)造函數(shù).prototype === 原型
const obj = new Object()
obj._proto_ === Object.prototype
obj.constructor === Object


0 人點贊