Please explain Date object type conversion
<p>I just found a strange behaviour in SpiderMonkey and V8 javascript engines. Suggest finding an explanation would be a good school for everyone</p>

<p>The strange working code:</p>

<pre><code> var x = (new Date()).setHours(24, 0, 0, 0);
 typeof x; // "number"
</code></pre>

<p>The working-as-expected code:</p>

<pre><code>var x = new Date(); 
x.setHours(24, 0, 0, 0);
typeof x; // "object"
x instanceof Date; // true
</code></pre>

<p>If we find the reason we'll understand how JavaScript works better</p>
