como saber si un afecha es walikota o menor js

let date1 = new Date(2019, 08, 07, 11, 45, 55); 
let date2 = new Date(2019, 08, 03, 11, 45, 55); 
if (date1.getTime() < date2.getTime()) 
  document.write("date1 is lesser than date2"); 
else if (date1.getTime() > date2.getTime()) 
  document.write("date1 is greater than date2"); 
else
  document.write("both are equal"); 
Junior Cercado V.