Why are global variables added to a window object in JavaScript?
var a = 1;
console.log(window.a);
ECMAScript 2015 language specification does not say that declared var or function is added to window global objects. However, I would like to know why the global variable declared var is added as a property to the window object.
What I'm curious about is that it has nothing to do with ECMAScript language specification?
I used a translator, so please understand if it's weird.