level 8
jy03692141
楼主
<script>
function func(name,sex,age)
{
this.name=name;
this.sex=sex;
this.age=age;
this.get=get;
}
function get()
{
return this.name;
}
var e=new func("的","男","18");
var b=e.get();
document.write(b);
</script>
代码如上。请问第7行这个this.get=get;到底是干什么用的呢?把这个删掉 代码就不执行了。
2012年03月19日 11点03分
1
function func(name,sex,age)
{
this.name=name;
this.sex=sex;
this.age=age;
this.get=get;
}
function get()
{
return this.name;
}
var e=new func("的","男","18");
var b=e.get();
document.write(b);
</script>
代码如上。请问第7行这个this.get=get;到底是干什么用的呢?把这个删掉 代码就不执行了。