title: store date objects to array
body: <p>I have two dates and want to save the days in between (plus start and end date) in an array</p>
  
  <pre><code>    var date1 = new Date("Sep 23, 2013 12:00:00"); // Monday
      var date2 = new Date("Sep 26, 2013 12:00:00"); // Thursday
  
      var alldates = [];
  
      for (var i=0; date1 &lt;= date2; date1.setDate(date1.getDate() + 1), i++) {
          alldates.push(date1);
          }
  
      alert(alldates.join('\n'));
  </code></pre>
  
  <p>With this code <code>alert(alldates.join('\n'));</code> shows the following</p>
  
  <pre><code>    Fri Sep 27 2013 12:00:00 GMT+0200
      Fri Sep 27 2013 12:00:00 GMT+0200
      Fri Sep 27 2013 12:00:00 GMT+0200
      Fri Sep 27 2013 12:00:00 GMT+0200
  </code></pre>
  
  <p>I am new to Javascript and want to get further understanding, so thank you for any explanation why the <code>alert</code> does not show</p>
  
  <pre><code>    Mon Sep 23 2013 12:00:00 GMT+0200
      Tue Sep 24 2013 12:00:00 GMT+0200
      Wed Sep 25 2013 12:00:00 GMT+0200
      Thu Sep 26 2013 12:00:00 GMT+0200
  </code></pre>