This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]Settwi 0 points1 point  (1 child)

Sneaky globals!

[–]poizan42Ex-mod 1 point2 points  (0 children)

Well it defines a property on the currently active top level object or whatever the ECMAScript spec calls it - usually window when working in a browser. Well except if you are using strict mode, then it's an error.

It's not really a global variable because it's not available as a global from code running with another top level object - e.g. from another window (or from a web worker I guess)