Why does the following code not initialize my JavaScript object?
<pre><code>MyClass = function() {
    var init = function() {
        console.log("Initializing");
    }
    this.init();
}
var myInstance = new MyClass();
</code></pre>

<p>When I run the above I get</p>

<p>TypeError: Object [object Object] has no method 'init'</p>
