API reference › @evolu/common › Set › firstInSet
function firstInSet<T>(set: NonEmptyReadonlySet<T>): T;
Defined in: packages/common/src/Set.ts:314
Returns the first element of a non-empty set (by insertion order).
Reading the first value
import { assertEqual, createSet, firstInSet } from "@evolu/common";
const set = createSet(["a", "b", "c"]);
assertEqual(firstInSet(set), "a");