0
I need help ! How to output random numbers without repeating in JavaScript?
I need help ! How to output random numbers without repeating in JavaScript?
5 Respostas
+ 4
pseudocodeExpl
generate randNum
append to array
print randNum
loop
if randNum in array
don't print
+ 1
num = (Math.floor(Math.random() * n)); // random num from 0 to n-1
https://code.sololearn.com/W7Lm9Ufx4cna/?ref=app
0
no comments...
- 1
Math.random