var obj = {}; function mi(global, object){ for (var key in global) if(global[key] === object) return key; return false; } alert(mi(window, obj))