title: Are same name functions in different classes supported in Nodejs?
body: <p>Can nodejs have two functions in different classes with the same name ?
  If not then why not ? otherwise there is something wrong in the code.</p>
  
  <p>Following is the example;</p>
  
  <pre><code>var admins = require('./routes/admins');
  var users = require('./routes/users');
  </code></pre>
  
  <p>Both singleton classes</p>
  
  <pre><code>var users = function users(){ 
  
       this.foo = foo = function(bar){ ...
       }
  }
  
  users.getInstance = getInstance = function(){
      if(this.instance == null){
          this.instance = new users();
      }
      return this.instance;
  }
  
  module.exports = users.getInstance();
  </code></pre>
  
  <p>The <strong>admin</strong> class is also similar, both the classes have the same function names as well. </p>
  
  <p>Now when <strong>foo</strong> is called it gets called of <strong>user</strong> class no matter what.
  If i change the <em>require</em> order the <strong>foo</strong> of admin class is called.</p>