Why don't number literals have access to Number methods?
<p>If you look at the ECMAScript 3 specification you will see that primitive value types Null and Undefined don't have accompanying Null and Undefined Objects.</p>

<pre><code>&gt;&gt; Null
ReferenceError: Null is not defined
</code></pre>

<p>The other primitive value types Number, String and Boolean types do have accompanying Number, String and Boolean objects which you can reference from global scope.  </p>

<pre><code>&gt;&gt;Number
function Number() { [native code] }
&gt;&gt;Boolean
function Boolean() { [native code] }
</code></pre>

<p>The purpose for these primitive value types is to provide methods such as <code>toString</code> and <code>valueOf</code> for their respective primitive value types:</p>

<pre><code>&gt;&gt;var n = 1;
&gt;&gt;n.toString();
"1" 
</code></pre>

<p>is the same as</p>

<pre><code>&gt;&gt;var n = 1;
&gt;&gt;Number.prototype.toString.call(n);
"1"
</code></pre>

<p>Booleans and strings also work that way:</p>

<pre><code>&gt;&gt;var b = true;
&gt;&gt;b.toString(); 
"true"
&gt;&gt;Boolean.prototype.toString.call(b);
"true"
</code></pre>

<p>You can see that the primitive value objects are using the methods of their accompanying object when you try to mix types:</p>

<pre><code>&gt;&gt;Boolean.prototype.toString.call(n); 
TypeError: Boolean.prototype.toString is not generic
&gt;&gt;Number.prototype.toString.call(b)
TypeError: Number.prototype.toString is not generic
</code></pre>

<p>Interestingly enough for boolean and string literal types, you can call these methods directly from the literal:</p>

<pre><code>&gt;&gt;true.toString();
"true"
&gt;&gt;Boolean.prototype.toString.call(true)
"true"
&gt;&gt;"moo".toString();
"moo"
&gt;&gt;String.prototype.toString.call("moo")
"moo"
</code></pre>

<p>Primitive values null and undefined, since they don't have accompanying Null and Undefined objects cannot do these things:</p>

<pre><code>&gt;&gt;Null
ReferenceError: Null is not defined
&gt;&gt;null.toString()
TypeError: Cannot call method 'toString' of null
</code></pre>

<p>Primitive value type number behaves like a mix of the two. You can call <code>toString</code> on a literal if you directly use the Number's prototype object's method:</p>

<pre><code>&gt;&gt;Number.prototype.toString.call(1);
"1"
</code></pre>

<p>But you cannot access the method from the literal itself like you can with strings and booleans:</p>

<pre><code>&gt;&gt;1.toString()
SyntaxError: Unexpected token ILLEGAL
</code></pre>

<p>Why is it that number literals behave differently from boolean and string even though there's a Number object?</p>
