I have given two different code. One inside global window object and second inside foo function
Here my First code:
var undefined = 2; // 2
console.log(undefined == 2); // it gives me FALSE
var window = 5; // 5
console.log(window == 5); // it gives me FALSE
var a;
console.log(a); // it give me UNDEFINED
Here my second code:
function foo() {
var undefined = 2; // 2
console.log(undefined == 2); // true
var window = 5; // 5
console.log(window == 5); // true
var a;
console.log(a);
}
foo();
false,true,undefinedundefinedis often passed as an argument to plugin constructors to ensure that the value is preserved and not redefined. it is really not a thing to dovarbefore undefined, when it is here, undefined gets actually overriden and the results are what he writes