Random()

Returns a random number within a defined range.

The Random() function has two parameters:

  • lowerBound (number): Required. The smallest number that the function can return.
  • upperBound (number): Required. The largest number that the function can return.

To use this function, pass it a lower and an upper bound. The numbers can be positive or negative integer or decimal numbers. The order of the upperBound and lowerBound parameters in the function doesn’t matter.

The function returns a random number that is greater than or equal to the smallest number, and less than or equal to the largest number.