Go to content Go to menu

Try it out for yourself.

<script type="text/javascript">
//The setup
var hash = {}
hash[window] = 'a firefox window'

//The test
for (var i in hash) {
	alert( i == window ) // false
	alert( typeof(i)   ) // string
	alert( hash['[object Window]'] ) // 'a firefox window'
}
</script>

Apparently, toString() is called on objects that get used as keys.