title: explicit declaration of one-time variable
body: <p>The following code is the skeleton of a function library:  </p>
  
  <pre><code>var anObject() {
  
      var private = function() {
          if(typeof oneTimeVar === 'undefined') {
              oneTimeVar = //  code to define oneTimeVar      
          }
      }();
  
      var public = function() {
         return //value using oneTimeVar
      };
  
      this.public=public;
  }
  
  //instantiated:
  var foo = new anObject();
  </code></pre>
  
  <p>The variable <em>oneTimeVar</em> should only be determined once per instantiation of <em>anObject</em>, and behaves, as intended, as a private member of the object.  However, it's not explicitly declared as a variable, which makes me a little leery.  Is there some other syntax that applies to this situation which should be utilized?</p>