title: Why do I get an Uncaught TypeError with private JS ES5 class call?
body: <p>I am attempting to make a class in JavaScript (ES5). However, when I call one method from another, I get the following error message in console:</p>
  
  <blockquote>
    <p>Uncaught TypeError: root.abLog is not a function</p>
  </blockquote>
  
  <p>The offending article in question (stripped down to show only the relevant parts) is as follows:</p>
  
  <pre><code>var abClass = function(options) {
  
      var root = this;
  
      this.checkAttach = function(text){
          root.abLog('Checking attached');
          /* snip */
      };
  
      var abLog = function(data) {
          console.log('abClass PATH: "'+vars.path+'"');
          console.log('abClass: '+data);
      };
  
  };
  </code></pre>
  
  <p>Both <code>root.abLog('Checking attached');</code> and <code>this.abLog('Checking attached');</code> result in similar errors.</p>
  
  <p>What have I done wrong with what I understand is a private method?</p>