title: Javascript "classes" prototype vs internal function declaration vs etc
body: <p>I know this has been answered before, but I am still confused (which is not entirely my fault as I notice the answers can be radically different from each other).</p>
  
  <p>I come from a Java background so if you can define anything as static, private, public, etc like then that should help me understand.</p>
  
  <p>Basically I want to make a completely custom class, but am unsure about prototype/etc.
  Example (using one function type):</p>
  
  <pre><code>function myClass()
  {
      var a;
      var b;
  
      var helper = function()
      {
          this.a += this.b;
      }
  
      var helper2 = function(a,b)
      {
          return(a + b);
      }
  
      var getA = function()
      {
          return(this.a);
      {
  
      var staticMethodThatNeedsToBePublic = function()
      {}
  }
  
  var myInstance = new myClass();
  
  myClass.prototype.example1 = function(){};
  myClass.example2 = function(){};
  </code></pre>
  
  <p>So how should this actually have been written? (I tried to include all the basic function types, but if I missed any feel free to add then) [note: I don't particularly care about this specific example, I just thought it might be helpful to the conversation but feel free to just answer my general question]</p>