title: When to add members to a prototype?
body: <p>In the below code,</p>
  
  <pre><code>function Stack() {
      this.stac = new Array();
      this.pop = function () {
          return this.stac.pop();
      }
      this.push = function (item) {
          this.stac.push(item);
      }
  }
  </code></pre>
  
  <p>How to decide whether <code>push</code> and <code>pop</code> are instance members of <code>Stack</code> class (shown above) or members of <code>Stack.prototype</code>?</p>