I am studying JS and was wondering why any not defined JS Object property returned undefined.
window.myVar // undefined
and now If I try to access the global property myVar (which is kind of the same as window.myVar) JS will throw an error:
myVar // error: myVar is not defined
notice that initializing variable with
var myVar; // undefined
so, could someone please explain what is the process behind this?