Welcome to collectivesolver - Programming & Software Q&A with code examples. A website with trusted programming answers. All programs are tested and work.

Contact: aviboots(AT)netvision.net.il

Buy a domain name - Register cheap domain names from $0.99 - Namecheap

Scalable Hosting That Grows With You

Secure & Reliable Web Hosting, Free Domain, Free SSL, 1-Click WordPress Install, Expert 24/7 Support

Semrush - keyword research tool

Boost your online presence with premium web hosting and servers

Disclosure: My content contains affiliate links.

39,890 questions

51,817 answers

573 users

How to create an array of dates in Node.js

1 Answer

0 votes
const dates = [new Date('2024/04/20'), new Date('2024/06/21'), new Date('2024/07/13'), 
               new Date('2024/03/14'), new Date('2024/05/20')]; 
             
 
for (let i = 0; i < dates.length; i++) {
    console.log(dates[i].toDateString());
}
  
  
  
  
  
/*
run:
  
Sat Apr 20 2024
Fri Jun 21 2024
Sat Jul 13 2024
Thu Mar 14 2024
Mon May 20 2024

*/

 



answered Apr 1, 2022 by avibootz
...