title: How do I create an empty copy of an object?
body: <p>I am creating some objects from JSON and I would like to make an empty copy of an object. I would have all the same properties but empty values. What are some good ways of doing this?</p>
  
  <p>Right now I am doing it as follows but would like it to be dynamic from the objects I create from the JSON I receive.</p>
  
  <pre><code>var myObject = { "Address": { "Address1": "", "Address2": "", "Address3": "", "Address4": "", "City": "", "": "", "": "", "Country": "", "Id": -1, "LastModified": "", "PostBackAction": null }, "Id": -1, "Amenities": "", "Directions": "", "LastModified": "", "LocalAttractions": "", "LocalLodging": "", "LocalRestaraunts": "", "Name": "", "Pictures": "", "Prices": "", "Region": 0, "PostBackAction": null };
  </code></pre>
  
  <p>A possible solution that doesn't work because it copies the values.</p>
  
  <pre><code>var myObject = JSON.parse(JSON.stringify(objectToBeCopied));
  </code></pre>