Skip to main content

abRandom

A function that returns either 0 or 1 with a 50% probability.

It can be used when performing A/B testing.


Code

🔗 View source code


Interface

typescript
const abRandom: () => 0 | 1

Usage

typescript
import { abRandom } from '@modern-kit/utils';

const ab = abRandom();