API reference › @evolu/common › Random › Random
Defined in: packages/common/src/Random.ts:34
A simple wrapper around Math.random().
For more complex needs check RandomLibDep.
Example
// For apps
const random = createRandom();
random.next();
// For tests
const random = createRandomWithSeed("test");
random.next();
Properties
next
next: () => RandomNumber;
Defined in: packages/common/src/Random.ts:36
Returns a floating point number in [0, 1). Just like Math.random().