Returning-A-Random-Number-In-Range

Returning a random number in a range


Docs and Source

MDN Docs


Explanation and Notes

You can use the Math.random function to return a number in a range.


Code Example

const num = Math.random() * 28;

// => Will return a random floating point number under 28

#JavaScript