title: Loop over an object and assign a value to an array of objects if certain conditions are met - vanilla JavaScript
body: <p>Say I have an object like so (there could be a lot of items in here);</p>
  
  <pre><code>myObject:{
   item1: {
    visible: true;
   },
   item2: {
    visible: true;
   },
   item3: {
    visible: false;
   },
  }
  </code></pre>
  
  <p>and then an array of objects like so (there could be a lot of items in here); </p>
  
  <pre><code>var objs = [ 
      { name: 'item1', visible: false },
      { name: 'item2', visible: false },
      { name: 'item3', visible: false }
  ];
  </code></pre>
  
  <p>How do I iterate through the object and assign the value of visible to the array <strong>only when the names match</strong> -  <strong>If Item1 in the object is <code>visible: false</code>, then item1 in the array must reflect that</strong></p>