Why {}.toString can check data type?
<p>Can anyone explain a bit about why these codes can check data type? They does not make sense to me. I cannot understand what the codes do behind the scene. Thanks in advance!</p>

<pre><code>var toClass = {}.toString // {} is for what? toString is a method?

alert(toClass); // alert it I get a function? = &gt; function toString() {[native code]}

alert( toClass.call( [1,2] ) )  
alert( toClass.call( new Date ) ) 
</code></pre>
