Scenario: I'm trying to figure out an existing HTML / JavaScript site with a confusing API. It adds several properties to the window object. I would like to list only those properties that are not built-in or standard (e.g. exclude window.location , window.parent , etc.)
Is there an idiomatic JavaScript way to do this? I thought about making a shallow copy on an empty HTML page, and then βsubtractingβ these properties in some way when listing the real one.
Ideally, I need a way to reset objects to the console or to the clock, as if none of the usual window properties existed, only those that were added with the JavaScript source code.
source share