第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號安全,請及時綁定郵箱和手機(jī)立即綁定

Student和Student.prototype是什么關(guān)系圖中為什么只有Student.prototype沒有student

同樣的Person和Person.prototype什么關(guān)系,Person應(yīng)該在圖中的什么位置

正在回答

2 回答

Person.prototype.constructor指向Person。

實(shí)例查找屬性或方法會先從構(gòu)造函數(shù)開始查,所以如果Person有一個name屬性且Person.prototype也有一個name屬性,通過實(shí)例.name返回的是Person上的name屬性

function a(){this.name="aaa"}

//undefined

a.prototype.name="ccc"

//"ccc"

var b=new a()

//undefined

b.name

//"aaa"

a.prototype.name

//"ccc"


0 回復(fù) 有任何疑惑可以回復(fù)我~

student.prototype ? 可以理解成是student的本體

0 回復(fù) 有任何疑惑可以回復(fù)我~

舉報

0/150
提交
取消

Student和Student.prototype是什么關(guān)系圖中為什么只有Student.prototype沒有student

我要回答 關(guān)注問題
微信客服

購課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動學(xué)習(xí)伙伴

公眾號

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號