Skip to content

sample

Picks up to n random unique values.

ts
import { sample } from '@vielzeug/toolkit';

sample([1, 2, 3, 4], 2); // e.g. [4, 1]