问题1
var Obj = function(msg){
_this = this;
this.msg = msg; this.shout = function(){
console.log(this.msg);
}
this.waitAndShout = function(){
setInterval(this.shout,1000)
}
} a =new Obj("你傻啊");
a.waitAndShout();
弹出 未定义
var Obj = function(msg){
_this = this;
this.msg = msg; this.shout = function(){
console.log(this.msg);
}
this.waitAndShout = function(){
setInterval(function(){_this.shout()},1000)
}
} a =new Obj("你傻啊");
a.waitAndShout();
弹出 你傻啊
问题二
alert(++[[]][+[]]+[+[]]);
等于10?