Static members in javascript
<p>I am tring to emulate static members in javascript.</p>

<p>consider this code:</p>

<pre><code> // option A for static members:

     // constructor...
  function Person(name) {

      this.firstName=name;        
  }

  Person.count=0;              //  like a static member...
  var p=new Person("Dan");
  Person.count++;

  alert(Person.count);   // 1;
</code></pre>

<p>and now this one:</p>

<pre><code>  //  option B for static members:
          // constructor..
  function Person(name) {

      this.firstName=name;
      Person.prototype.count++;     

  }

  Person.prototype.count=0;        //  like a static member...
  var p=new Person("Dan");
  alert(Person.prototype.count);   // 1;

  //       ... 
</code></pre>

<p>so, is it true to say that the main difference between those two, is that in the second example you can refer to the static member from the constuctor (due to the <strong>prototype</strong> decleration), while in the first example you can't ?</p>
