javascript constructor 能修改吗

2024-12-13 15:38:56
推荐回答(1个)
回答1:



function employee(name,job,born)
{
this.name=name;
this.job=job;
this.born=born;
}

var bill=new employee("Bill Gates","Engineer",1985);

document.write(bill.constructor);


那么输出的结果是

function employee(name, job, born)
{this.name = name; this.job = job; this.born = born;}