title: Dot-notation for properties within Javascript constructors
body: <p>I'm working through a text book and a lesson introduces the use of dot notation when defining a constructor. (It is understood that there is other syntax to use to name a property.) When experimenting with permutations of the lesson, an outcome causes some confusion.</p>
  
  <p>One outcome is expected, undefined, from the following example:</p>
  
  <pre><code>function person(){
    person.thing = 2;
  }
  
  console.log(person.thing);
  // outcome: undefined
  </code></pre>
  
  <p>However, an alternative experiment with first creating an object from the constructor produces an unexpected outcome for the value of <code>person.thing</code>:</p>
  
  <pre><code>function person(){
    person.thing = 2;
  }
  
  var bob = new person();
  
  console.log(bob.thing);
  // outcome: undefined
  
  console.log(person.thing);
  // outcome: 2
  </code></pre>
  
  <p>Why is the value for the property <code>person.thing</code> now 2 after a differently named object, <code>bob</code>, was created from the constructor? </p>