I think the console should return 34 for me,but I got "undefined" in the vscode ide.
I run below code in the chrome, then I got 34.
I want to know why,and if my settings is the reason, how should I modify the settings?
function foo() {
console.log( this.a );
}
var obj = {
a: 2,
foo: foo
};
var bar = obj.foo;
var a = 34;
bar();
Thanks