title: How do you make classes in JavaScript?
body: <p>How do you guys make "classes" in JavaScript!?</p>
  
  <p>I am using:</p>
  
  <pre><code>function classFoo()
  {
     var classLevelVariable = 0;
  
     this.classFunction = function()
     {
        alert("The classFunction has been called.");
        classFunction2(); //Crash.  classFunction2 is "undefined."  
     }
  
     this.classFunction2 = function()
     {
        alert("classFunction2 called.");
     }
  }
  </code></pre>
  
  <p>I never was able to get constructors to work.  Tried</p>
  
  <pre><code>this.New = function(arguments)
  </code></pre>
  
  <p>Which worked once, but not in a second class.  So, I have now given up on those entirely, using my own "Initialize" functions which act as constructors.</p>
  
  <p>The weirdness with it working once, but not twice, makes me think typographical errors between the two classes... but I think in 19 years of coding, that that probably isn't it.</p>
  
  <p>I'm using Chrome's debugger, and I am not receiving any errors besides the second function being undefined when being called.</p>