Skip to content
party.js logoparty.js logo

ReferenceSamplersFunction

normal()

Picks random numbers that cluster around a mean.

function normal(mean: number, stdDev: number): SamplerFn<number>;

Creates a sampler that picks numbers from a normal (bell curve) distribution: most values land near mean, and fewer the further away they are. About 68% fall within one stdDev of the mean, about 95% within two and about 99.7% within three.

The values have no hard limits, so occasionally one can be produced that’s far from the mean. Prefer range() for properties that must stay within bounds, like a size that cannot be negative.

meannumber

The value the results cluster around.

stdDevnumber

How widely the results spread around the mean.

SamplerFn<number>