Use of 'prototype' vs. 'this' in Javascript?
<p>What's the difference?</p>

<pre><code>var A = function () {
    this.x = function () {
        //do something
    };
};
</code></pre>

<p>or</p>

<pre><code>var A = function () { };
A.prototype.x = function () {
    //do something
};
</code></pre>
