Quick Tip: Viewing the Javascript’s Global Namespace

When programming in Javascript you can inspect which objects are currently populating the global namespace. A quick way to view this list of objects is to type the word “window” into your browser’s console (see screenshot below for an example). This will return the Window DOM object which will contain a list of all objects which are currently populating the global scope.

Chrome's console window

Screenshot of Chrome’s Console Window

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s