I am learning javascript and I am unable to understand difference between global variable and window variable and in which namespace the variables will be stored
For example,
var a = 1;
alert(window.a);
This will create alert window with message '1'.
let b = 1;
alert(window.b);
This will create alert window with message 'undefined'.
But if b is not getting created in window space, where it is getting created. When we run a javascript program, will 2 namespaces be created (one for global and one for window)?