Answers for "get min max array js"

0

find min and max date in array 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));
Posted by: Guest on January-30-2021
1

js max array

Math.min(...arr) // min
Math.max(...arr) // max
Posted by: Guest on August-24-2021

Code answers related to "Javascript"

Browse Popular Code Answers by Language