Skip to content
Find file
5f96f33
5 lines (3 sloc) 305 Bytes

It's great that we can create random decimal numbers, but it's even more useful if we lot more useful to generate a random whole number.

To achieve this we can multiply the random number by ten and use the Math.floor() to convert the decimal number to a whole number

Math.floor(Math.random()*10)

Something went wrong with that request. Please try again.