JavaScriptDate對(duì)象屬性:prototype
編輯您的代碼:
function employee(name,job,born)
{
this.name=name;
this.job=job;
this.born=born;
}
var bill=new employee("Bill Gates","Engineer",1985);
employee.prototype.salary=null;
bill.salary=20000;
document.write(bill.salary);
查看結(jié)果:
20000
免責(zé)申明 --------------------------------------------------------------------------------------
以上內(nèi)容僅代表原創(chuàng)者觀點(diǎn),其內(nèi)容未經(jīng)本站證實(shí),中華考試網(wǎng)對(duì)以上內(nèi)容的真實(shí)性、完整性不作任何保證或承諾,轉(zhuǎn)載目的在于傳遞更多信息,由此產(chǎn)生的后果與中華考試網(wǎng)無關(guān);如以上轉(zhuǎn)載內(nèi)容不慎侵犯了您的權(quán)益,請(qǐng)聯(lián)系我們
,我們將會(huì)及時(shí)處理。