title: Javascript namespacing - how to export functions and variables defined within a function scope based on their naming?
body: <p>With the code below, other than specifying manually, is there a way to export only the functions and variables whose name doesn't start with an underscore?</p>
  
  <pre><code>var myapp = myapp || {};
  myapp.utils = (function() {
    var
      CONSTANT_A = "FOO",
      CONSTANT_B = "BAR";
  
    function func() {}
    function _privateFunc() {}
  
    return {//return all variables and functions whose name does not have the "_" prefix.}
  }());
  </code></pre>