Skip to content

Instantly share code, notes, and snippets.

@juanparati
Created August 14, 2014 09:22
Show Gist options
  • Save juanparati/e171e04e84b086a2e22f to your computer and use it in GitHub Desktop.
Save juanparati/e171e04e84b086a2e22f to your computer and use it in GitHub Desktop.
getInstaceOf from the same class, so we can retrieve the var name thas contains the object
/**
* Get instance names of an object
*
* Returns instances
*/
function getInstancesOf()
{
var instances = [];
for(var v in window) {
if(window.hasOwnProperty(v) && window[v] instanceof PlayerInterface) {
instances.push(v);
}
}
return instances;
}
@juanparati
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment