I'm trying to compare two same dates in the browser console and getting the result as false. I don't understand how is it comparing as both the dates are the same?
$(function()
{
  var d1 = new Date("01-12-2001");
  var d2 = new Date("01-12-2001");
  
  console.log(d1 == d2);
});<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>but here if try to compare with GT and LT then its working.
 
     
     
     
    