For example, window.location
is an original browser-defined property. But if I say window.test = "Hello";
that is a global variable, set by my custom JavaScript. Is there a way in JavaScript to differentiate between the two?
For context, my ultimate goal is to output a list of global variables, for debugging purposes but something like Object.keys(window);
outputs both the browser-defined properties and the custom ones.