title: Calling one method from another in a Javascript class
body: <p>When defining a class in Javascript, how can I call one method from another one?</p>
  
  <pre><code>exports.myClass = function () {
  
      this.init = function() {
          myInternalMethod();
      }
  
      this.myInternalMethod = function() {
          //Do something
      }
  }
  </code></pre>
  
  <p>The code above gives me the following error when executing it:</p>
  
  <blockquote>
    <p>ReferenceError: myInternalMethod is not defined</p>
  </blockquote>
  
  <p>I also tried this.myInternalMethod and self.myInternalMethod, but both lead to errors.
  What's the right way to do this?</p>