I am not able to understand the this keyword in Node.js
consider the code
var a=6
function fun(){
var a=2;
console.log(this);
console.log(this.a);//undefined
console.log("****",a);//2
}
fun();
In this a is defined at global scope and inside function fun().According to Scope rule of JavaScript a should return 2 and this.a should return 6 but in this code this.a is undefined where as a is 2.
Please explain the meaning of this in node.js and how it differs from this of javaScript.
Also, explain how to access the global a inside the function fun()