问题:
问两处console输出什么?为什么?
var User = {
count:1,
getCount:function(){
return this.count;
}
};
console.log(User.getCount()); // what?
var func = User.getCount;
console.log(func()); // what?
问题:
问两处console输出什么?为什么?
var User = {
count:1,
getCount:function(){
return this.count;
}
};
console.log(User.getCount()); // what?
var func = User.getCount;
console.log(func()); // what?