Last Updated: February 25, 2016
·
1.324K
· mlb

Bookmarklet : get my JavaScript custom globals

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

2 Responses
Add your response

Awesome, thanks!

over 1 year ago ·

awesome... really helpful for javascript developers

over 1 year ago ·