当我在 node 中输入这个时.js,我得到undefined
分.
var testContext = 15;
function testFunction() {
console.log(this.testContext);
}
testFunction();
=>undefined
Without var
keyword, it passes (=>15). It's working in the Chrome console (with and without var
keyword).