What is the difference between storing in proto and this?
<p>Im probably missing the point totally here so apologies. But Im wondering what the difference between using 'this' and 'prototype' are in this context. And what I should really be using to construct rich classes that are reusable...</p>

<p>I have this...</p>

<pre><code>function MyClass() {

}

MyClass.prototype.name = null;

MyClass.prototype.init = function () {

    console.log('init');

    MyClass.prototype.name = 'Peter set by proto';

    this.name = 'Peter set by this';

};

MyClass.prototype.SayName = function() {

    console.log(MyClass.prototype.name);
    console.log(this.name);
};
</code></pre>

<p>And on the page..</p>

<pre><code>&lt;script type="text/javascript"&gt;


        var myClass = new MyClass();
        myClass.init();
        myClass.SayName();

    &lt;/script&gt;
</code></pre>

<p>The output is...</p>

<pre><code>init
Peter set by proto
Peter set by this
</code></pre>

<p>So whats the differenve between proto and this I thought they both basically access the object/class...?</p>
