Skip to content

Instantly share code, notes, and snippets.

@xk
Created November 5, 2015 13:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save xk/22f7d78ec4353e0149b6 to your computer and use it in GitHub Desktop.
Save xk/22f7d78ec4353e0149b6 to your computer and use it in GitHub Desktop.
Muestra las variables globales
(function buscarVariablesGlobales (dirtySet, cleanSet) {
//© 2013-02-19 jorge@jorgechamorro.com
dirtySet= document.body.appendChild(document.createElement('iframe'));
cleanSet= Object.getOwnPropertyNames(dirtySet.contentWindow);
dirtySet.parentNode.removeChild(dirtySet);
dirtySet= Object.getOwnPropertyNames(function () { return this }());
return dirtySet.filter(function (v,i,o) { return cleanSet.indexOf(v) < 0 });
})()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment