title: javascript: call a default function?
body: <p>I need to make some js functionality like that:</p>
  
  <pre><code>let text =function()
  {
      this.main = ...;
      this.toArr = ...;
  };
  
  let t = new text();
  
  console.log( t() ); // call a function 'main' in text;
  t().toArr(); // call a function 'toArr' in text;
  </code></pre>