type detection

このエントリは、http://d.hatena.ne.jp/uupaa/20091006 の続きです。

alert(Object.prototype.toString.call())

Firefox3+ [object Window]
IE6+ [object Object]
Google Chrome4 [object global]
Safari4 [object DOMWindow]
iPhone3.1.2 [object DOMWindow]
Opera10+ [object Window]

alert(new Function())

Firefox3+ function anonymous() {}
IE6+ function anonymous() {}
Google Chrome4 function anonymous() {}
Safari4 function anonymous() {}
iPhone3.1.2 function anonymous() {}
Opera10.10 function() {}
Opera10.50 function anonymous() {}