title: Extending an object with multiple properties in JavaScript
body: <p>I have a global JavaScript object with multiple properties and functions that I am creating it this way:</p>
  
  <pre><code>myObject = {};
  </code></pre>
  
  <p>I thought that I can easily extend this object by creating something like this</p>
  
  <pre><code>myObject = { propA1 : null, ....., propAN : null};
  </code></pre>
  
  <p>instead of</p>
  
  <pre><code>myObject.propA1 = null;
  myObject......;
  myObject.propAN = null;
  </code></pre>
  
  <p>What's wrong with my approach?</p>