Skip to content

random()

Maingron edited this page Apr 2, 2021 · 1 revision

Get a random number

Code

random(min = 0, max = 256, decimals = 0, runs = 3);

Variables

  • min = Smallest possible number returned
  • max = Highest possible number returned
  • decimals = Number of decimals the returned number has
  • runs = Randomisation runs

Note: Positive numbers only.
If you don't pass any parameters to random(), it just returns Math.random().

Example

random(0, 98542, 4, 3);

Explanation

random() returns a random number. You can specify many parameters, which you can't with Math.random(). If you don't specify any parameters, it acts like Math.random() and is fully compatible with it.

Clone this wiki locally