title: Compare two date object in angular 4
body: <p>I tried to compare two date objects in angular 4 but it always returning false</p>
  
  <p>below are my code snippet</p>
  
  <pre><code>CheckForHoliday(d: Date) {
    let simpleDate = new Date(d.getFullYear(), d.getMonth(), d.getDay());
    let hDate = new Date(2018, 9, 1);
    console.log(simpleDate + "==========" + hDate);
    console.log(hDate === simpleDate);
  
    return (hDate === simpleDate);
  }
  </code></pre>
  
  <p>The output is as below</p>
  
  <p><em>Mon Oct 01 2018 00:00:00 GMT+0530 (India Standard Time)==========Mon Oct 01 2018 00:00:00 GMT+0530 (India Standard Time)</em></p>
  
  <p><em>false</em></p>
  
  <p>Any Idea why it returning false when the printed values look same?</p>