Or it does not really matter. navigator is a property of the window object, but all properties of the window object are available as global variables.
navigator === window.navigator; //-> true
As a personal preference, I always write window.propertyName for the explicit properties of the window object.
source share