title: Return Array After For Loop
body: <p>Having a hard time understanding for loops in arrays. Trying to create a Thank You card creator and these are the steps I'm trying to follow:</p>
  <ol>
  <li>Create a new, empty array to hold the messages</li>
  <li>Iterate through the input array and inside the loop build out the 'thank you' message for each name using string interpolation, then add that message to the new array you created</li>
  <li>After the loop finishes and all of the messages have been added to the new array, return the new array.</li>
  </ol>
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code> const names = []
  function writeCards(names, event) {
    for (let i = 0; i &lt; names.length; i++) {
      console.log(`Thank you, ${names[i]} for the wonderful ${event} gift!`);
    return names;
  }</code></pre>
  </div>
  </div>
  </p>
  <p>Not sure if I'm on the right track. Thanks for your help!</p>