Is there a way for javascript to detect all assigned variables? For example, if one js file creates a bunch of vars (globally scoped), can a subsequent file get all the vars
There is the this variable. This is an object or an array, and you can simply put:
this
for(i in this) { //do something }
Unfortunately, it will return everything under the this object.