title: Javascript while loop infinite loop
body: <p>I'm not all that experienced of a code and I'm stuck on a  the while loop towards the bottom of the block of code below</p>
  
  <p>My code is supposed to get the date, check if today is a day when we don't ship (saturdays, sundays, holidays) and, if it is, add 1 day until until it finds the next day that we are on open on and write it to the document. </p>
  
  <pre><code>var target = new Date();
  var targetDay = target.getDay();
  var targetDate = target.getDate();
  var targetMonth = target.getMonth();
  
  function checkIfClosedOnTarget(targetDay,targetDate,targetMonth){
      var areOpenOnTarget = true;
      if(
           targetDay == 0 || 
           targetDay == 6  ||
           (targetDate == 1 &amp;&amp; targetMonth == 0) || // New Year's Day
           (targetMonth == 4 &amp;&amp; targetDate &gt;= 25 &amp;&amp;  targetDay == 1) || // Memorial Day
           (targetMonth == 6 &amp;&amp; targetDate == 4) || //Independence Day
           (targetMonth == 8 &amp;&amp; targetDate &lt;= 7 &amp;&amp; targetDay == 1)|| //Labor Day
           (targetMonth == 10 &amp;&amp; targetDate &lt;= 28 &amp;&amp; targetDate &gt;= 22 &amp;&amp; targetDay == 4)|| // Thanksgiving Day
           (targetMonth == 11 &amp;&amp; targetDate == 25)
       ){
           areOpenOnTarget = false;
       }
  
      if(areOpenOnTarget){
          return true;
      }else{
         return false;
      }
  };
  
  function addDaysUntilNextOpenDay() {
       while(checkIfClosedOnTarget(targetDay,targetDate,targetMonth) == false){
       target.setDate(target.getDate() + 1);
       }
   };
  addDaysUntilNextOpenDay();
  
  document.write("&lt;p&gt;Next shipment will ship out on " + target.getMonth() + " " +   target.getDate + ", " + target.getYear) + " at 4:00pm Pacific Standard Time ";
  </code></pre>