I have jquery code like :
                   var date_time=elem.added_date;
                   var date = date_time.split(' ');
                   var dates=new Date();
                   var currentDate = dates.getFullYear()+"-"+(dates.getMonth()+1)+"-"+dates.getDate();
                  // alert(currentDate);
                   //alert(date[0]);
                   var age=currentDate-date[0];
currentDate: is the currentdate comming like (2018-06-30)
date[0] :in this i am getting the dob like (1988-01-30)
how can i get the age from the both of two values i am stuck here can anyone please help me related this
 
    