O'Reilly logo

Mastering JavaScript Design Patterns - Second Edition by Simon Timms

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

What's the matter with global scope anyway?

In browser based JavaScript every object you create is assigned to the global scope. For the browser, this object is simply known as window. It is simple to see this behavior in action by opening up the development console in your favorite browser.

Tip

Opening the Development Console

Modern browsers have, built into them, some very advanced debugging and auditing tools. To access them there is a menu item, which is located under Tools | Developer Tools in Chrome | Tools | Web Developer in Firefox, and directly under the menu as F12 Developer Tools in Internet Explorer. Keyboard shortcuts also exist for accessing the tools. On Windows and Linux, F12 is standard and, on OSX, Option + Command + I is used. ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required