Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Latest commit

 

History

History
History
30 lines (18 loc) · 702 Bytes

File metadata and controls

30 lines (18 loc) · 702 Bytes
Copy raw file
Download raw file
Outline
Edit and raw actions

random Range

Return a pseudo-random value within a range of numbers.

Math.randomRange(0, 10)

Returns a pseudo-random number in the range [min, max]; that is, from 0 (inclusive) up to including 1 (inclusive), which you can then scale to your desired range.

Parameters

  • min: the smallest possible pseudo-random number to return.
  • max: the largest possible pseudo-random number to return.

Returns

  • a pseudo-random number between min (inclusive) and max (inclusive).

Example

Generate a random number between 0 and 100.

let centoRandom = Math.randomRange(0, 100);

See Also

random

Morty Proxy This is a proxified and sanitized view of the page, visit original site.