title: Merge 2 arrays of objects setting key from one and value from the other
body: <p>I have 2 objets <code>a</code> and <code>b</code> defined as the following : </p>
  
  <pre><code>a = {
    1:3,
    2:5,
    3:1,
  }
  
  b = {
    1:{name:"Bob"},
    2:{name:"John"},
    3:{name:"Alice"}
  }
  </code></pre>
  
  <p>What I am trying to get is the following object <code>c</code> defined as </p>
  
  <pre><code>c = {
    "Bob":3,
    "John":5,
    "Alice":1
  }
  </code></pre>
  
  <p>So creating an  using b[key].name as c[key] and a[key] as value.</p>
  
  <p>What I tried so far is </p>
  
  <pre><code>const mapAandB = (a, b) =&gt; {
    let finalObject = [];
    Object.keys(b).forEach(key =&gt; {
      return finalOdds.push({ [b[key].name]: a[key] });
    });
    return finalOdds;
  };
  </code></pre>
  
  <p>but then the result is </p>
  
  <pre><code>c = [
    0:{Bob:3}, 
    1:{John: 5}, 
    2:{Alice:1}
  ]
  </code></pre>
  
  <p>If you have any suggestion ...</p>