var a = ['11-05-2018', '12-05-2017', '10-04-2017']; a.sort(); alert(a); alert('12-05-2017' > '11-05-2018')