find min and max date in array javascript

JavaScript
const dates = [];
dates.push(new Date('2011/06/25'));
dates.push(new Date('2011/06/26'));
dates.push(new Date('2011/06/27'));
dates.push(new Date('2011/06/28'));
const maxDate = new Date(Math.max.apply(null, dates));
const minDate = new Date(Math.min.apply(null, dates));
Source

Also in JavaScript: