title: How to reset na object property to the default one?
body: <p>I am using jQuery and I am still pretty new to JavaScript. I am implementing an object as the following:</p>
  
  <pre><code>MyObject = {
    properties     : [{}],
    resetProperties: function resetProperties() { this.properties = [{}] }
  };
  </code></pre>
  
  <p>As you can see in the above code I can reset the <code>properties</code> by running <code>MyObject.resetProperties()</code> but, in order to do that, I state <em>two</em> times the <code>[{}]</code> variable. How should I accomplish the same thing without repeating that code?</p>
  
  <hr>
  
  <p><strong>Update</strong></p>
  
  <p>I tried to do the following:</p>
  
  <pre><code>MyObject = {
    properties       : this.propertiesDefault,
    resetProperties  : function resetProperties() { this.properties = [{}] },
    propertiesDefault: [{}]
  };
  </code></pre>
  
  <p>but I get "<code>TypeError: invalid 'in' operand MyObject.properties</code>" and I am not sure that is the right way to proceed.</p>