Skip to content

Instantly share code, notes, and snippets.

@geomago
Last active June 13, 2020 15:46
Show Gist options
  • Save geomago/9c33b0949d47218491ffdd1c8eb63a1e to your computer and use it in GitHub Desktop.
Save geomago/9c33b0949d47218491ffdd1c8eb63a1e to your computer and use it in GitHub Desktop.
undeclared_js_vars_step_1
glob = {}; // global object to keep the initial list of properties
glob.initial = Object.keys(window); // save all window properties before any script is loaded
// showDiff shows (on console.log) the list of "new" properties
glob.showDiff = function(before,after) {
after.forEach( function(prop) {
if (before.indexOf(prop)<0) {
console.log(prop,': ', window[prop]);
}
});
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment