我在类似数组中的日期
dates=[18-06-2018,19-06-2018,20-06-2018,21-06-2018,25-06-2018]
我需要这样的输出
from date:18-06-2018
to date:21-06-2018
from date:25-06-2018
to date:25-06-2018
我该如何实现
答案 0 :(得分:0)
尝试一下:-
dates=['18-06-2018','19-06-2018','20-06-2018','21-06-2018','25-06-2018']
console.log('From date:'+dates[0]+'\n'+'to date:'+dates[3]);
console.log('From date:'+dates[4]+'\n'+'to date:'+dates[4]);