title: JavaScript compare two arrays(key/value pairs) and copy value from one to the other if key matches
body: <p>I have two arrays containing key/value pairs. </p>
  
  <pre><code>{
      "containerOne": [{
          "Id": 1,
              "Title": "TitleOne",
              "Responsibility": "ValueOne"
      }, {
          "Id": 2,
              "Title": "TitleTwo",
              "Responsibility": "ValueTwo"
      }]
  }
  
  {
      "containerTwo": [{
          "Id": 1,
              "Title": "TitleOne",
              "Responsibility": null
      }, {
          "Id": 2,
              "Title": "TitleTwo",
              "Responsibility": "null         
                                 }
              ]
      }
  </code></pre>
  
  <p>I'd like to compare both arrays and compare the title of each container. If the titles match, then I'd like to copy the Responsibility value from containerOne to containerTwo. The ID's will not match, so that can be ruled out. Only the titles will be consistent.</p>
  
  <p>What is the most efficient way to do this please?]</p>
  
  <p>Thanks</p>
  
  <p>=====================================================================</p>
  
  <p>EDIT</p>
  
  <p>=====================================================================</p>
  
  <p>Looking at the arrays a little closer, there is a subtle difference in the data being returned:</p>
  
  <pre><code>{
  "AMLookupTasksList":
      [
          {
              "Id":1,
              "Title":"Create and Maintain an Onboarding Document",
              "Responsibility":"1. Onboarding|f101ccf1-c7d5-42e7-ba8f-48e88ac90a3d"
          },
          {
              "Id":2,
              "Title":"Execute Onboarding for New Consultants",
              "Responsibility":"1. Onboarding|f101ccf1-c7d5-42e7-ba8f-48e88ac90a3d"
          }
      ]
  </code></pre>
  
  <p>}</p>
  
  <pre><code>{
  "AMTasksList":
      [
          {
              "Id":4,
              "Title":
                  {
                      "$M_1":13,"$c_1":"Create and Maintain an Onboarding Document"
                  },
              "Responsibility":null
          },
          {
              "Id":17,
              "Title":
                  {
                      "$M_1":12,"$c_1":"Execute Onboarding for New Consultants"
                  },
              "Responsibility":null
          }
      ]
  </code></pre>
  
  <p>}</p>
  
  <p>Do I have additional looping to get to the Title value in the second array?</p>