I want to let the user define certain variables without overriding existing ones. For example, an allowed new variable:
myJSON = 123
And an invalid one:
JSON = 123
Because it overrides the existing JSON object. Before adding I could simply check if the variable is different from undefined. But I would prefer to show the user which variables are already taken too.
How can I get a comprehensive list of the browser's built-in variables?
Note that Object.keys(window) and Object.keys(document) don't contain JSON. Which other places should I check to get a comprehensive list of taken variables?