Contact: aviboots(AT)netvision.net.il
38,546 questions
50,217 answers
573 users
let dates = []; dates.push(new Date("2020/03/20")); dates.push(new Date("2020/05/21")); dates.push(new Date("2020/01/13")); dates.push(new Date("2020/02/27")); dates.push(new Date("2020/05/20")); console.log(dates); /* run: [ 2020-03-20T00:00:00.000Z, 2020-05-21T00:00:00.000Z, 2020-01-13T00:00:00.000Z, 2020-02-27T00:00:00.000Z, 2020-05-20T00:00:00.000Z ] */
let dates = ['2020/03/20', '2020/05/21', '2020/01/13', '2020/02/27', '2020/05/20']; console.log(dates); /* run: [ "2020/03/20" , "2020/05/21" , "2020/01/13" , "2020/02/27" , "2020/05/20" ] */
const dates = [new Date('2021/03/20'), new Date('2021/05/21'), new Date('2021/01/13'), new Date('2021/01/14'), new Date('2022/05/20')]; for (let i = 0; i < dates.length; i++) { console.log(dates[i].toDateString()); } /* run: Sat Mar 20 2021 Fri May 21 2021 Wed Jan 13 2021 Thu Jan 14 2021 Fri May 20 2022 */