I never looked as global variables as
properties of the
window object.
Also understanding how the engine work and deal with undefined variables vs undefined properties totally blown my mind!
At the beginning I thought maybe it is a scope thing but then I realized, it if wasn't in the function's scope it will move to the higher scope. I felt so dumb. It''s how the engine treat things differently. I think getting more into details like these makes the one a better developer.
Thanks a lot Josh