title: Replace two object property values and create new array
body: <p>I need to take an existing array of objects, replace the names depending on two different id's, and create a new array. I also need to make sure all other properties don't change.</p>
  
  <p>My JSON:</p>
  
  <pre><code>const legendData = [{
  
       "assetManagerId": 11,
       "name": "AIM Derivatives",
       "fileTypeId": 1,
   {
       "assetManagerId": 11,
       "name": "AIM Derivatives",
       "fileTypeId": 2,
   },
   {
       "assetManagerId": 8,
       "name": "Barings",
       "fileTypeId": 2,
   },
   {
       "assetManagerId": 5,
       "name": "BlackRock",
       "fileTypeId": 1,
  }]
  </code></pre>
  
  <p>I need the AIM Derivatives names to change to the below, however, keep the rest the same.</p>
  
  <pre><code>const = legendData[{
       "assetManagerId": 11,
       "name": "AIM Derivatives ODIN",
       "fileTypeId": 1,
   {
       "assetManagerId": 11,
       "name": "AIM Derivatives CMF",
       "fileTypeId": 2,
   },
   {
       "assetManagerId": 8,
       "name": "Barings",
       "fileTypeId": 2,
   },
   {
       "assetManagerId": 5,
       "name": "BlackRock",
       "fileTypeId": 1,
  }]
  </code></pre>
  
  <p>I got halfway with my code below, however, don't know how to combine both. The below only changes if the fileTypeId is 1 but not 2.</p>
  
  <pre><code>const newArr = legendData.map(item =&gt; item.assetManagerId === 11 &amp;&amp; item.fileTypeId === 1? {
              ...item, name: "AIM Derivatives ODIN"
              } : item)
  
  console.log(newArr)       
  </code></pre>