每日一题 2020-11-13
下面这段JS程序的执行结果是:
var user = {
count : 1,
getCount: function(){
return this.count;
}
}
var func = user.getCount
console.log(func())
答案: undefined
解析:
this 指向 window
var func = user.getCount
var func = function(){
return this.count;
}
window.count = undefined

下面这段JS程序的执行结果是:
浙公网安备 33010602011771号