returns the minimum of the given dates

Solutions on MaxInterview for returns the minimum of the given dates by the best coders in the world

showing results for - "returns the minimum of the given dates"
Matteo
12 Aug 2019
1const tips_minDate = dates => new Date(Math.min(...dates));
2const array = [
3 new Date(2016, 4, 13),
4  new Date(2018, 3, 12),
5  new Date(2016, 0, 10),
6  new Date(2017, 0, 9)
7];
8console.log(tips_minDate(array)); // 2016-01-08T22:00:00.000Z 
9