function employee()
{
//this.salary=123;
//employee.prototype.salary=333;
employee.salary=222;
}
employee.salary=222;
var bill=new employee();
alert(employee.salary);//222
alert(bill.salary);//undefined?????为什么不是222
function employee()
{
//this.salary=123;
//employee.prototype.salary=333;
employee.salary=222;
}
employee.salary=222;
var bill=new employee();
alert(employee.salary);//222
alert(bill.salary);//undefined?????为什么不是222
13 回答13k 阅读
7 回答2.1k 阅读
3 回答1.3k 阅读✓ 已解决
6 回答1.2k 阅读✓ 已解决
2 回答1.4k 阅读✓ 已解决
3 回答1.3k 阅读✓ 已解决
6 回答1.1k 阅读
bill是employee的实例。employee.prototype.salary才能由bill访问。