title: How to declare a javascript class with short function names and assign later to a long class name?
body: <p>Let me explain, this is about displaying class source code in IDEs. I have always only one class per file. A class is declared like this in the file mod1.js:</p>
  
  <pre><code>MYGLOB.MOD1.ClassXy = function () {
    //constructor, do somothing
  }
  
  MYGLOB.MOD1.ClassXy.prototype.memberfunc1 = function () {
    //member function 1, do somothing
  }
  </code></pre>
  
  <p>(There are many more functions like memberfunc1 in the real class.) </p>
  
  <p>But in different IDEs and editors the width of the function list is now very large. I want the function lists to display only the last part of the function name (the function name itself). </p>
  
  <p>How about this:</p>
  
  <pre><code>ClassXy = function () {
    //constructor, do somothing
  }
  
  memberfunc1 = function () {
    //member function 1, do somothing
  }
  
  MYGLOB.MOD1.ClassXy = ClassXy;
  MYGLOB.MOD1.ClassXy.prototype.memberfunc1 = memberfunc1;
  </code></pre>
  
  <p>It displays nice in the function list. It does not disturb that there are the 2 long assignments at the bottom of the file. But I have the global namespace polluted. How to do this without affecting the global namespace with the global "ClassXy" and "memberfunc1"? (MYGLOB.MOD1.ClassXy is fine.) </p>
  
  <p>Can I do this with parens / closures somehow or what do you suggest? And keep the effect of having the clean function list in the IDE, at least the first part of the function list showing me the member function with their short names?</p>
  
  <p>Please don't suggest different IDEs or editors, this is not about choosing a different code editor, please open a different question on your own if you want to discuss that. This question is about javascript and classes.</p>
  
  <p>Maybe this is a simple thing, but I am quite new to javascript.</p>