var name and window.name

javascript

Solution

If `name` is a global variable, then `name` and `window.name` are equivalent.

Global variables and functions are members of the global object. In browsers, the global object contains a window member whose value is the global object.

Problem

If I define a JavaScript global variable called `name`, does that hide the window.name property? I ask this in the context of the Facebook JavaScript authentication API, since I noticed that having a global of that name would break it, and also since I see that `window.name` is used in their code.

Original source

Related problems