Provides methods for producing random values.
- Source:
Methods
(static) float(minopt, maxopt) → {Number}
Returns a random float between min
and max
.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
min |
Number |
<optional> |
0 | |
max |
Number |
<optional> |
1 |
- Source:
Returns:
- Type
- Number
(static) integer(minopt, maxopt) → {Number}
Returns a random integer between min
and max
.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
min |
Number |
<optional> |
0 | |
max |
Number |
<optional> |
1 |
- Source:
Returns:
- Type
- Number
(static) key(bag) → {String}
Returns a random key in bag
.
Parameters:
Name | Type | Description |
---|---|---|
bag |
Array | Map | Object |
- Source:
Returns:
- Type
- String
(static) sign() → {Number}
Returns a random sign as a positive or negative 1
.
- Source:
Returns:
- Type
- Number
(static) value(bag) → {*}
Returns a random value in bag
.
Parameters:
Name | Type | Description |
---|---|---|
bag |
Array | Map | Object | Set |
- Source:
Returns:
- Type
- *