Skip to content

Latest commit

 

History

History
13 lines (11 loc) · 264 Bytes

get_highest_date.md

File metadata and controls

13 lines (11 loc) · 264 Bytes

Get highest date

const maxDate = (...dates) => new Date(Math.max.apply(null, ...dates));

const array = [
  new Date(2017, 4, 13),
  new Date(2018, 2, 12),
  new Date(2016, 0, 10),
  new Date(2016, 0, 9)
];
maxDate(array); // 2018-03-11T22:00:00.000Z