title: Comparing two dates using JavaScript not working as expected
body: <p>Here is my javascript code:</p>
  
  <pre><code>var prevDate = new Date('1/25/2011'); // the string contains a date which
                                        // comes from a server-side script
                                        // may/may not be the same as current date
  
  var currDate = new Date();            // this variable contains current date
      currDate.setHours(0, 0, 0, 0);    // the time portion is zeroed-out
  
  console.log(prevDate);                // Tue Jan 25 2011 00:00:00 GMT+0500 (West Asia Standard Time)
  console.log(currDate);                // Tue Jan 25 2011 00:00:00 GMT+0500 (West Asia Standard Time)
  console.log(prevDate == currDate);    // false -- why oh why
  </code></pre>
  
  <p>Notice that both dates are the same but comparing using <code>==</code> indicates they are not the same. Why?</p>