import { sample } from "https://deno.land/x/simplestatistics@v7.8.0/index.js";
Create a simple random sample
from a given array of n
elements.
The sampled values will be in any order, not necessarily the order they appear in the input.
Examples
var values = [1, 2, 4, 5, 6, 7, 8, 9];
sample(values, 3); // returns 3 random values, like [2, 5, 8];
var values = [1, 2, 4, 5, 6, 7, 8, 9]; sample(values, 3); // returns 3 random values, like [2, 5, 8];