var val1 = 'hello me';
function test() {
var val1 = 'hello he';
fs.readFile(path.join(__dirname, '/test.js'), function(err, data){
var val1 = 'hello you' +
'';
console.log(this.val1);
console.log(this === GLOBAL);
});
}
test();
console.log
undefined true
为啥子?
求问下this为什么是全局对象?
异步回调函数中的上下文是怎么确定的?