title: How to declare local function inside ES6 class?
body: <p>I have a function that can be used only inside a class and don't want it to be accessible outside the class.</p>
  
  <pre><code>class Auth {
    /*@ngInject*/
    constructor($http, $cookies, $q, User) {
      this.$http = $http;
      this.$cookies = $cookies;
      this.$q = $q;
      this.User = User;
  
      localFunc(); // Need to create this function, and need it to be accessible only inside this class
    }
  }
  </code></pre>
  
  <p>What I have done so far is declaring the function outside the class</p>
  
  <pre><code>function localFunc() {
    return 'foo';
  }
  class Auth {
    ...
  }
  </code></pre>
  
  <p>However, this's not good as it pollutes the global function, except I wrapped it inside IIFE. So, is there somehow I can create a local function inside a ES6 class?</p>