title: javascript 2D array vlaue exchange
body: <p>I would like to compare two arrays and replace the array value with the same property value.</p>
  <pre><code>let first_array =[{ model: 'aa', size: '85(XS)', count: 200, number: '10-2' },{ model: 'bb', size: '105(XL)', count: 150, number: '' },{ model: 'cc', size: '95(M)', count: 100, number: '9-2' },{ model: 'dd', size: '85(XS)', count: 50, number: '' }]
  
  let second_array = [{ model: 'aa', size: '85(XS)', count: 1, number: '' },{ model: 'bb', size: '105(XL)', count: 1, number: '' },{ model: 'cc', size: '95(M)', count: 2, number: '' },{ model: 'dd', size: '85(S)', count: 3, number: '' },{ model: 'dd', size: '80(XS)', count: , number: '' }]
  </code></pre>
  <p>Assuming there are two array.
  Comparing the 'a' and 'b' arrays, the same 'size' as the 'model' inserts the count value of the 'a' array into the count value of the 'b' array, and the wrong one is marked as null.</p>
  <p>And this is what I want.</p>
  <pre><code>let vlaue = [{ model: 'aa', size: '85(XS)', count: 200, number: '10-2' },{ model: 'bb', size: '105(XL)', count: 150, number: '' },{ model: 'cc', size: '95(M)', count: 100, number: '9-2' },{ model: 'dd', size: '85(XS)', count: 50, number: '' }]
  </code></pre>
  <p>That's the code I tried.</p>
  <pre><code>for (var j = 0; j&lt;second_array.length;j++){
  
    for(var i = 0; i &lt; first_array.length ;i++){
      var count = false 
      
      if(second_array[j][&quot;model&quot;]+second_array[j][&quot;size&quot;] === first_array[i]){
         
         count = true
  
      }else{
  
         count = false
  
      }
  
      if(count == true){
          if(objectdata[first_array[i]][&quot;count&quot;] === 0){
            second_array[j][&quot;count&quot;] = &quot;&quot;
            second_array[j][&quot;number&quot;] = &quot;&quot;
          }else{
              second_array[j][&quot;count&quot;] = objectdata[first_array[i]][&quot;count&quot;];
               second_array[j][&quot;number&quot;] = objectdata[first_array[i]][&quot;number&quot;];
          }
          
         
          break
      }else{
          second_array[j][&quot;count&quot;] = &quot;&quot;
          second_array[j][&quot;number&quot;] = &quot;&quot;
      }
  </code></pre>
  <p>}
  }</p>