It doesn't matter in any case. Although navigator is a window object property, all window object properties are accessible as global variables. For explicit properties of the window object, I always write window. propertyName as a personal preference.