Considering the code below. I'm defining a property on an object Weird for a reset button which is in present in the DOM. However, if I check the window - the property is also present? How come this happens?
I'm browsing in Chrome Version 49.0.2623.87 (64-bit).
var Weird = Weird || {};
Weird.start = function(){
this.reset = document.getElementById("reset");
};
document.addEventListener("DOMContentLoaded", function(){
Weird.start();
console.log(Weird.reset) // Works but expected
console.log(reset); // Works?
console.log(window.reset); // Works?
console.log(window.Weird.reset); // Works?
});