-2

whatever is accessible in window object, is global? I am confused if whatever is contained in window object or whatever is accessible via window. is global?

I'm trying to type in window.something in the console , so whatever is accessible with "window." are they all global?

  • http://stackoverflow.com/questions/6679635/is-window-really-global-in-javascript – zxqx May 01 '14 at 21:37
  • Yes, but only those properties directly assigned to `window`. If you'd create a property to `window` as an object, like `window.obj = {prop: 'Prop'};`, `prop` in `obj` is not global. – Teemu May 01 '14 at 22:10

1 Answers1

2

Yes, in browsers, window is the global object.

Chuck
  • 234,037
  • 30
  • 302
  • 389
  • and whatever is accesible under window. is global too right? So basically if I can access a variable with window.variablename then variablename is global . Is it? – user3593511 May 01 '14 at 21:43