title: How do I clone/extend a FormData object?
body: <p>I have a set of POST endpoints where I need to send a collection of static parameters plus a few dynamic parameters specific to the request. </p>
  
  <p>For every request, I am doing the following:</p>
  
  <pre><code>var staticParams = {...}, // some arbitrarily large object
      localParams = {...},
      formData = new FormData();
  
  Object.keys(staticParams).forEach(function(key) {
    formData.append(key, staticParams[key]);
  });
  
  Object.keys(localData).forEach(function(key) {
    formData.append(key, localParams[key]);
  });
  </code></pre>
  
  <p>It's not a huge tax, but it seems silly to repeat the first enumeration for <em>every request</em>. <strong>How can I clone and extend my <code>FormData</code> object so that I don't have to build the whole thing every time?</strong></p>
  
  <hr>
  
  <p>FWIW, I know <a href="https://stackoverflow.com/questions/122102/what-is-the-most-efficient-way-to-clone-an-object">how to clone Objects</a>; I believe <code>FormData</code> is unique in that the key/value pairs are not simply keys on the Object, so I am unclear on the correct way to clone it.</p>