Fetching all (javascript) global variables in a page

Or you could simply run;

Object.keys(window);

It will show a few extra globals (~5), but far fewer than the for (var i in window) answer.

Object.keys is available in Chrome 5+, Firefox 4+, IE 9+, and Opera 12, ty @rink.attendant.6

Leave a Comment