title: Elegant way to code partially copy objects in Javascript?
body: <p>I have a javascript object that represents form fields. about 70% of these fields have to be copied in some objects for sending to server, other fields are for UI usage. Presently I clone objects by manually creating assignments for each field, that result in rather not nice structures, as shown below. Note that I would keep field names identical for parts being copied.</p>
  
  <pre><code>var contData = {
                  ContainerType: data.ContainerType,
                  ProjectIds: data.ProjectIds,
                  PrivateToProjects: data.PrivateToProjects,
                  DimensionType:data.DimensionType,
                  MetricsX: data.MetricsX,
                  MetricsY: data.MetricsY,
                  Parent:data.Parent,
                  ContainerName:data.Prefix
              };
  </code></pre>
  
  <p>What would be the best way to code cloning part of object, just specifying list of fields to clone/not to clone, such as some useful helper function?</p>
  
  <p>I also use angular and jquery.</p>