So, we could argue that using
document is "best practice."
window object is part of the "unofficial" Browser Object Model (BOM,) but has been left (so far) working so as not to break old websites. The two identifiers are basically synonymous. Ie:
The window object is supported by all browsers. It represents the browser's window.
Global variables are properties of the window object.
Global functions are methods of the window object.
Even the document object (of the HTML DOM) is a property of the window object:
So you use either or both (full qualification) to get at global HTML objects, properties and methods.
But, it may be that the opposite is not true. You may need to specifically go through the BOM
window object in order to access unofficial BOM objects. (