function maxDate(dates) {
let max = dates[0],
obj = new Date(dates[0]);
dates.forEach(function(dt, index) {
if (new Date( dt ) > obj) {
max = dt;
obj = new Date(dt);
}
});
return max;
}
let dates = ['2020/03/20', '2020/05/21', '2020/01/13', '2020/01/14', '2020/05/20'];
console.log(maxDate(dates));
/*
run:
2020/05/21
*/