Why are not all properties inherited/accessible from the built-in Object (Javascript)?
<p>In all the books/materials that I've read, they talk about in universal, absolute terms that all instances of an object inherit and have access to methods of the prototype the object was created from.  For the most part, this seems generally true.  But this doesn't seem to be as  universal as I have read.  A simple example:</p>

<p>The length property is undefined for the objects that are typeof number.</p>

<p>For example:</p>

<pre><code>x = 5;
typeof x;
=&gt; returns number
number.length
=&gt; returns undefined
</code></pre>

<p>I understand that it wouldn't make much sense for a number to have a length (though I suppose it could reflect the number of digits in the number), the part that bothers me is that everything I've ready talks about this absolute principle of inheritance.  And since everything is derived from the built-in Object, and even the built-in Number object has the length property, why would that property not be accessible in the example above for x?</p>
