Bookmarklet : get my JavaScript custom globals

Posted on

Too many global variables is bad. And slower than local ones.

Want to know when you forgot a var statement or when you need to decrease the number of custom globals in your page ? Put the following link in your Bookmarks bar and open the console when you click on it.

javascript:console.log((function(a,b,c,d,e,f,g,h,i){for(e%20in%20window)a.push(e);f=document.createElement("iframe"),f.style.display="none",document.body.appendChild(f),g=f.contentWindow;for(h%20in%20g)b.push(h);for(i=a.length;i>d;d++)~b.indexOf(a[d])||c.push(a[d]);return%20c})([],[],[],0))

Enjoy

Leave a Reply

Your email address will not be published.