title: Loop through an array and add any objects with a matching parameter to a new array
body: <ul>
  <li>Add a function named <code>findByArtist</code>. This function should:
  <ul>
  <li>Take an input parameter for a string artist</li>
  <li>Create an array to hold any results, empty to start</li>
  <li>Loop through the <code>collection</code> and add any objects with a matching title to the array.</li>
  <li>Return the array with the matching results. If no results are found, return an empty array.</li>
  </ul>
  </li>
  </ul>
  <p>Collection is my an arrray with multiple objects in it like this:</p>
  <pre><code>0: {TITLE: &quot;Welcome Home&quot;, ARTIST: &quot;Aries&quot;, YEAR: &quot;2020&quot;}
  1: {TITLE: &quot;Appeal To Reason&quot;, ARTIST: &quot;Rise Against&quot;, YEAR: &quot;2008&quot;}
  2: {TITLE: &quot;Endgame&quot;, ARTIST: &quot;Rise Against&quot;, YEAR: &quot;2011&quot;}
  3: {TITLE: &quot;Wolves&quot;, ARTIST: &quot;Rise Against&quot;, YEAR: &quot;2017&quot;}
  4: {TITLE: &quot;Sleepy Little One&quot;, ARTIST: &quot;Kupla&quot;, YEAR: &quot;2020&quot;}
  5: {TITLE: &quot;Kingdom in Blue&quot;, ARTIST: &quot;Kupla&quot;, YEAR: &quot;2020&quot;}
  length: 6
  </code></pre>
  <p>PROBLEM:
  I can't get the function work as it always returns 'artist not found in collection' even when I type the artist string when I run the function.  For example:</p>
  <pre><code>
      console.log(findByArtist('Rise Against'));
  
  </code></pre>
  <pre><code>
      function findByArtist(artist) {
      let searchArtist = [];
        for (let i = 0; i &lt; collection.length; i++) {
        const element = collection[i];
          if (artist == element.ARTIST) {
          searchArtist.push(element);
          return searchArtist;
      
          } else {
          console.log('Artist not found in collection');
          return searchArtist;
          }//End if else
        }//End for loop
      }//End function
  
  </code></pre>