Skip to content

pick

pick<T>(items): T

Defined in: src/global/collections.ts:15

One element. Throws when the collection is empty.

T

Collection<T>

T

pick(["rock", "paper", "scissors"]); // "paper"
pick("abcdef"); // "d"
pick(new Set([1, 2, 3])); // 2