title: Only allowing one instance of a class member in javascript
body: <p>I am creating a helper class in front of the google map API - just for the sake of learning.</p>
  
  <p>I'd like to keep only one instance of the google.maps.Map object around in my class, even if someone decides to instantiate another instance of the class.</p>
  
  <p>I'm coming from a .NET background, and the concept is simple there - however I'm still getting acclimated to javascript (and ES6), so any pointers are much appreciated.</p>
  
  <p>Here's a snippet sort of explaining (through comments) what I'm going for.</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>class Foo {
      constructor(bar) {
          // If someone else decides to create a new instance
          //  of 'Foo', then 'this.bar' should not set itself again.
          // I realize an instanced constructor is not correct.
          // In C#, I'd solve this by creating a static class, making
          //  'bar' a static property on the class.
          this.bar = bar;
      }
  }</code></pre>
  </div>
  </div>
  </p>