+ 4

How to random in JS

I want to create random numbers, I not know how to random, code: var a = ??? document.write(a);

13th Dec 2017, 2:32 PM
КirillEjuka
2 Answers
+ 7
var a = Math.floor(Math.random() * 10); Prints random 'whole' numbers between 10
13th Dec 2017, 2:33 PM
Cool Codin
Cool Codin - avatar
+ 4
Thanks!
13th Dec 2017, 2:34 PM
КirillEjuka