Skip to content

random

random<T>(arbitrary, ctx): T

It takes an arbitrary and a context, and returns a random value of the type that arbitrary generates

Example

random(integer())
// => 123

Type Parameters

T

Parameters

arbitrary

Arbitrary<T>

The arbitrary to generate a value from.

ctx

ArbitraryContext = ...

The context used for random value generation.

Returns

T

A random value of type T.