title: Can't loop over grouped array in JS
body: <p>Unfortunately I have again problems with my grouped messages. I have already received a lot of help from you, so I feel a bit embarrassed to ask again - but I'm not getting ahead with this. </p>
  
  <p>My first goal was to group messages by their created_date. Thanks to your help this works very well now. Now I have tried to output the grouped messages, but it does not work. I slowly don't understand the whole thing anymore...</p>
  
  <p>I want to output the group key (date) first and then every single message in each group. This is what I’ve tried:</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>jQuery(document).ready(function ($) {
      let messages = [{
          sender_id: "0",
          message: "Test",
          created_at: "Thu Mar 12 2020 17:26:23 GMT+0100 (Mitteleuropäische Normalzeit)"
      }, {
          sender_id: "0",
          message: "Hallo",
          created_at: "Thu Mar 12 2020 17:26:23 GMT+0100 (Mitteleuropäische Normalzeit)"
      }];
  
      let groupedMessages = [];
  
      $(messages).each(function (index, message) {
          let createdAtDate = new Date(message["created_at"]).toLocaleDateString(navigator.language, {
              day: "2-digit",
              month: "2-digit",
              year: "numeric"
          });
  
  
          if (typeof groupedMessages[createdAtDate] === "undefined") {
              groupedMessages[createdAtDate] = [];
          }
  
          groupedMessages[createdAtDate].push(message);
      });
  
      console.log(groupedMessages);
  
      if (groupedMessages &amp;&amp; groupedMessages.length &gt; 0) {
          $(groupedMessages).each(function (index, messages) {
              console.log(index); //Expected output: 12.03.2020
  
              $(messages).each(function (index, message) {
                  console.log(message["sender_id"]);
                  console.log(message["message"]);
                  console.log(message["created_at"]);
              })
          });
      }
  });</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"&gt;&lt;/script&gt;</code></pre>
  </div>
  </div>
  </p>