title: What does checkDate(date)[0] mean?
body: <ol>
  <li>Can anyone explain what is meant by <code>!checkDate(date)[0]</code>?</li>
  <li>Is it true that the function <code>checkDate(date)</code> passes the Javascript date object as an argument? Is that the case that the JavaScript object doesn't need to be initialized when it pass as argument?</li>
  </ol>
  
  <p></p>
  
  <pre><code>$("form").on("submit",function(event) {
  var date;
  try {
      date = $.datepicker.parseDate("mm/dd/yy", $("#date").val());
   } catch (error) { }
  if (!date) {
    event.preventDefault();
    alert("Please provide a valid date.");
  }
  if (date &amp;&amp; !checkDate(date)[0]) {
    event.preventDefault();
    alert("Cannot select a weekend or Tuesday for Dr.Smith.");
  }
  });
  
  function checkDate(date) {
    var isWeekday = date.getDay() &gt; 0 &amp;&amp; date.getDay() &lt; 6;
    if ($("#doctor").val() === "Smith") {
       return [isWeekday &amp;&amp; date.getDay() != 2];
     } else {
       return [isWeekday];
     }
  };
  </code></pre>