JavaScript constructor and prototype object
<p>I am curious as to what's going on here.  As you can see, I have defined a constructor function called <code>range</code> to build new <code>range</code> objects.  I've extended the <code>range</code> constructor through it's prototype, adding a simple <code>includes</code> method.  I've created my new object and used the variable of <code>p</code>.  When I attempt to use this method with my <code>range</code> objects, all is well and it works as expected.  The problem is when I try to look at at <code>p.prototype</code> it tells me that it's type is undefined and <code>p.prototype</code> has no methods...  Huh??</p>

<p>What's going on here??  How is <code>p</code> an object and <code>p.prototype</code> is not?</p>

<pre><code>    function range(from, to) {
        this.from = from;
        this.to = to;
    }


    range.prototype = {
        includes: function(x) { return this.from &lt;= x &amp;&amp; x &lt;= this.to; },
    }

    var p = new range(1, 4);

    console.log(typeof p) //outputs object
    console.log(typeof p.prototype) //outputs undefined

    console.log(Object.getOwnPropertyNames(range.prototype)); //outputs includes
    console.log(Object.getOwnPropertyNames(p.prototype)); //throws error, p.prototype is not an object
</code></pre>
