Geting-Random-Integers-With-Math-Library

Get random integers with the Math library


Explanation and Notes

You can get a random integer (whole number) using this code snippet.

Usually the Math.random library will return floating point numbers, but you can get around that using Math.floor().


Code Example

Math.floor(Math.random() * 28)

#JavaScript