['2020-9-1','2020-9-2','2020-9-3'] 怎么取最小的时间
转时间戳排序:
array.sort((a, b) => (new Date(a)).valueOf() - (new Date(b)).valueOf())[0];
或者转时间戳取最小值(推荐):
Math.min.apply(null, array.map(item => (new Date(item)).valueOf()));
2.1m questions
2.1m answers
60 comments
57.0k users