Promissa saysThe window object is the global scope and exposes viewport size, scrolling, and dialogs.
window is the browser global — globals are its properties. It gives viewport size (innerWidth/innerHeight), scroll position (scrollY) and control (scrollTo), window.open/close, and dialogs (alert/confirm/prompt — blocking, avoid in production). Many properties are global, so innerWidth works without the window. prefix.
Power-ups you unlock
window = the global scope object
innerWidth/innerHeight, scrollY, scrollTo
window.open/close for popups
alert/confirm/prompt block — avoid in prod
Race Condition Rex attacks — common mistakes
Relying on blocking dialogs in real UIs
Popups blocked outside a user gesture
Polluting the global (window) namespace
Boss battleReport the viewport size and scroll the page to the top with scrollTo.