Two items (dates) the same in logger but not fulfilling "if" condition. Javascript / Google Scripts
<p>I'm having trouble meeting an if condition and I've run out of ideas. I've been using the logger to check if the two variables are the same, and they appear identical in the logger and the code runs fine. Here is my code:</p>

<pre><code>//Get two ranges from Google sheets and turn into values, (inputValues and datesValues)
...
for (var i = 0; i &lt; inputValues.length; i++) {
  if ((inputValues[i][2].length &gt; 0) &amp;&amp; (inputValues[i][29].length &gt; 0)) {
    //This creates an event in Google Calendar. Works fine.
    var eventNum = i;
    Logger.log(datesValues[3][4]); // this is to test - results below
    Logger.log(inputValues[eventNum][30]);
      for (var k = 0; k &lt; datesValues.length; k++) {
        if (datesValues[k][4] == inputValues[eventNum][30]){
          Logger.log("yes");
          //Things in this loop that I want to do but can't.
            }
          }
       }
     }
</code></pre>

<p>Here is what the Logger returns:</p>

<p>[16-12-12 09:11:50:951 PST] Thu Dec 15 20:00:00 GMT+01:00 2016</p>

<p>[16-12-12 09:11:50:952 PST] Thu Dec 15 20:00:00 GMT+01:00 2016</p>

<p>I'm basically not able to trip the second "<code>if</code>" clause, even though there is an "<code>i</code>" such that <code>datesValues[3][4] == inputValues[eventNum][30]</code>. Those logs look identical to me! The for loop before the if loop is also working correctly, <code>datesValues.length = 50</code>.</p>

<p>Is there something weird in javascript about dates and logical operators that I don't know about?</p>

<p>Thanks!</p>