title: Object.assign() and array of objects
body: <p>I have a nested array like this</p>
  
  <pre><code>const names= [[{name: "John"}, {name: "Mary"}],
             [{name: "Paul"}, {name: "Peter"}]];
  </code></pre>
  
  <p>I would like inject <code>country</code> into the nested object </p>
  
  <pre><code>const country = {country :"USA"}
  </code></pre>
  
  <p>so that output looks like</p>
  
  <pre><code>[{name: "John", country : "USA"}, {etc} ,{etc} ]
  </code></pre>
  
  <p>The code idea have is something like this</p>
  
  <pre><code>const combined = names.map((map)=&gt; 
         Object.assign({}, 
                country, 
                /*something to extract name from nested array names*/),
         {country}
           )
  </code></pre>
  
  <p>Any suggestions how i could spread the object in the nested array to form the desired output?</p>
  
  <p>If the code could be improved in other ways, please let me know as well</p>