Skip to main content
The Deno 2 Release Candidate is here
Learn more
Module

x/collection/src/Collection.ts>Collection#randomKey

Utility data structure for Deno (Discord.js Collection).
Latest
method Collection.prototype.randomKey
import { Collection } from "https://deno.land/x/collection@v1.0.1/src/Collection.ts";

Obtains unique random key(s) from this collection. This relies on Collection#keyArray, and thus the caching mechanism applies here as well.

Returns

K

A single key if no amount is provided or an array

Parameters

amount: number