javascript 中的delete方法为什么不加括号?
function createhero(name,home,weap) {
this.name = name;
this.home = home;
if (weap == undefined) {
this.weap = 'jian'
}else{
this.weap = weap;
}
this.skill = function(){
alert(this.name+'向敌人发动攻击');
}
}
var hero1 = new createhero('赵日天','断罪小学','刀');
delete hero1.name; //为什么不写成delete(hero1.name) |
免责声明:本内容仅代表回答会员见解不代表天盟观点,请谨慎对待。
版权声明:作者保留权利,不代表天盟立场。
|
|
|
|