I’m currently adding a javascript feature to a page of a site that’s terribly designed (runs on an ancient PHP CMS built in the year 2000 in PHP 4), and terribly implemented, with far too much going on in a way that it shouldn’t.
Anyway, I wanted to see if there was already a javascript value set for the data I required. Here’s how you dump every single JS variable to the console.log() :
for (var b in window) { if (window.hasOwnProperty(b)) { console.log(b); } }
Advertisements