title: How to call internal javascript Class methods?
body: <p>I'm new to OOP in JavaScript. Could someone please point out how I would go about calling an internal function from within a Class.</p>
  <p>For example, from the below code how would I call the <code>hello</code> function from with the <code>myFunction</code>:</p>
  <pre><code>// app.js file
  var Api = require('Api')
  var api = new Api();
  
  api.myFunction();
  
  //server.js file
  
  /**
   * API client.
   */
  function Api() {
      this.my_var = 'my variable';
  }
  
  /**
   * My Function
   */
  Api.prototype.myFunction = function() {
      // have tried this
      this.hello();
  
      // and this
      Api.hello();
  }
  
  /**
   * Hello
   */
  Api.prototype.hello = function() {
      console.log('Hello!');
  }
  
  // expose the Api class
  module.exports = Api;
  </code></pre>