title: Update object in array from another object in array
body: <p>In my code I have two arrays, first one contains multiple objects. While the second one is to store serialized form data (mapped to JSON). So both arrays are having identical keys. </p>
  
  <p>What I want to achieve is to update the values of an object in the original array based on the values of an object in new array dynamically, by ID in the object. </p>
  
  <p>Found some examples online but hard to get them to work. Because most of them are showing either one level of objects but I'm working on complex nested objects in the array. </p>
  
  <pre><code>var products = [
      {
          Id: 1,
          Name: 'Product1',
          Attributes: {
              Storage: 'Normal',
              Size: 'Small'
          }
      },
      {
          Id: 2,
          Name: 'Product2',
          Attributes: {
              Storage: 'Normal',
              Size: 'Small'
          }
      }
  ];
  
  var newData = [
      {
          Id: 2,
          Name: 'French Fries'
      },
      {
          Id: 1,
          Attributes: {
              Size: 'Medium'
          }
      }
  ];
  </code></pre>
  
  <p>The expected outcome is the <code>products</code> array now updated with the values from the second array.</p>
  
  <pre><code>Output:
  [
      {
          Id: 1,
          Name: 'Product1',
          Attributes: {
              Storage: 'Normal',
              Size: 'Medium'
          }
      },
      {
          Id: 2,
          Name: 'French Fries',
          Attributes: {
              Storage: 'Normal',
              Size: 'Small'
          }
      }
  ]
  </code></pre>