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,894 questions

51,825 answers

573 users

How to generate 10 digits random numbers in JavaScript

1 Answer

0 votes
for (var cout = 0; cout < 20; cout++) {
     var s = "";
     for (var i = 0; i < 10; i++) {
        s = s + (Math.floor(Math.random() * 9 + 0));  
     }
     document.write(s + "<br />");
}
  
 
  
/*
run:
      
6302188577
4627086086
5376205526
0551358500
1645703606
3732512521
7877630218
1622252347
4885771847
3757162574
7213710715
2487550555
1577127480
4743411108
6758030285
7375758171
3556731424
4000128866
6426476640
3188848732
      
*/

 



answered Jun 21, 2019 by avibootz
edited Jun 21, 2019 by avibootz

Related questions

1 answer 133 views
1 answer 111 views
1 answer 289 views
1 answer 114 views
1 answer 121 views
2 answers 220 views
1 answer 142 views
...