title: compare dates which gives me wrong result
body: <p>I need to  compare the startDate and endDate and if  <code>startDate&gt;endDate</code> then i need to take the starting date of the month of endDate as startDate suppose my
  startDate is <code>"startDate": "2016-05-30T00:00:00.000Z"</code> endDate is <code>"endDate": "2016-06-05T00:00:00.000Z"</code> then when compare need to get <code>true</code> but i am getting false </p>
  
  <p>Code:</p>
  
  <pre><code> var c=(new Date(nestedObj.startDate)).getDate();
    console.log("startdate"+" "+c);
    var d=(new Date(nestedObj.endDate)).getDate();
    console.log("endtdate"+" "+d);
    console.log(c&gt;d);
  </code></pre>
  
  <p>As you can see in the below snippet</p>
  
  <p><a href="https://i.stack.imgur.com/xySWI.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/xySWI.png" alt="enter image description here"></a></p>
  
  <p>Any help would be appreciated.</p>