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

51,784 answers

573 users

How to generate random number between 0 and 1 in TypeScript

1 Answer

0 votes
for (let i = 0; i < 20; i++)
    console.log(Math.random());





/*

run:

0.07410505036735449 
0.1412768066332395 
0.28483778672521165 
0.8848089149374309 
0.07778051701554711 
0.08044449888205418 
0.7591321739866292 
0.8560956598284649 
0.9331221472218125 
0.9377777195905801 
0.8480196427698871 
0.21765275970167552 
0.5079851650691435 
0.5933641223604026 
0.5329444803946589 
0.959154389143822 
0.7225519896235472 
0.11346354355368804 
0.7389669127362972 
0.43843092789803884 

*/
  
  

 



answered Oct 21, 2021 by avibootz

Related questions

1 answer 89 views
1 answer 142 views
2 answers 150 views
1 answer 150 views
1 answer 240 views
1 answer 144 views
1 answer 168 views
...