title: typeof !== "undefined", comparing dates, new Date, Math.min / What is wrong with this simple js code?
body: <p>This code is on my nodeJS server. Every time the server gets to it, it crashes. Don't know what's wrong... Could someone help me?</p>
  
  <p><code>dateArray[11]</code>, <code>dateArray[12]</code> and <code>dateArray[13]</code> are either empty or are Date values.</p>
  
  <pre><code>var dateArray11 = null;
  var tempDateValue = "";
  if ((typeof dateArray[11] !== "undefined") || (typeof dateArray[12] !== "undefined") || (typeof dateArray[13] !== "undefined")) {
      dateArray11 = new Date(Math.min((dateArray[11].getTime()), (dateArray[12].getTime()), (dateArray[13].getTime())));
      if (dateArray11.getTime() === dateArray[11].getTime()) {
          tempDateValue = 11;
      }
      if (dateArray11.getTime() === dateArray[12].getTime()) {
          tempDateValue = 12;
      }
      if (dateArray11.getTime() === dateArray[13].getTime()) {
          tempDateValue = 13;
      }
  }
  </code></pre>