Javascript date comparision

Here, i am going to give you very useful tips about

Javascript Date.

Some time you may face situation like this you need to compare two Javascript date less than, more than or equal. I am here comparing two specific Date with current Date.
var start_date = "2016-08-01";
var end_date = "2016-08-31";

var d = new Date;
var start_d = new Date(start_date);
var end_d = new Date(end_date);

var day = d.getDate();  // get day
var m = d.getMonth() + 1; // get month 
var y = d.getFullYear(); //get year

//create same format as your start_date and end_date
var todayDateText = y + "-" + m + "-" + day; 
var cu = new Date(todayDateText);

if (cu.getTime() >= start_d.getTime() && cu.getTime() <= end_d.getTime()){
when current date lies between start_date and end_date or match then it will alert 'true' otherwise 'false'