rand
can.fixture.rand
Create a random number or selection.
can.fixture.rand([min,] max)
Parameters
-
min
=0
{Number}
OptionalThe lower bound on integers to select.
-
max
{Number}
The upper bound on integers to select.
Returns
{Number}
A random integer in the range [min, max).
can.fixture.rand(choices, min[ ,max])
Parameters
-
choices
{Array}
An array of things to choose from.
-
min
{Number}
The minimum number of times to choose from choices.
-
max
=min
{Number}
OptionalThe maximum number of times to choose from choices.
Returns
{Array}
An array of between min and max random choices from choices.
can.fixture.rand
creates random integers or random arrays of other arrays.Examples