Skip to content

Instantly share code, notes, and snippets.

@geomago
Created June 13, 2020 15:11
Show Gist options
  • Save geomago/351013cbb40dca2733034301b2abfbd6 to your computer and use it in GitHub Desktop.
Save geomago/351013cbb40dca2733034301b2abfbd6 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.before = 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) {
for (let p in after) {
if (before[p] === undefined) {
console.log(p,': ', after[p], ' = ', window[p]);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment