DEV Community

huberto_madalena
huberto_madalena

Posted on

random num in js

1-use document.write for output
2- remember that document.write is the print command in other languages
3- you need to floor (round down) the random value to get a valid integer.
4- random is just that, random. it's totally unpredictable. you need to multiply it by a number in order to get a value within the desired range.

Top comments (0)