title: define property array of objects in Javascript
body: <p>I have initialized an object that I wish to add to dynamically. Specifically I want to add array of objects to this object. I have tried the below but neither work.. is there a way to do this correctly? The final output should be <code>object1.property1[0].value = 42</code> and <code>object1.property1[0].writable = false</code>.</p>
  
  <pre><code>const object1 = {};
  
  Object.defineProperty(object1, 'property1', '' );
  object1.property1 = [{value: 42, writable: false}];
  
  
  const object1 = {};
  Object.defineProperty(object1, 'property1', [{value: 42, writable: false}] );
  </code></pre>