Skip to content

at

ts
function Array.at<T>(
    target: readonly T[],
    offset: number,
): T | undefined

Returns the value at the specified offset.

Example

ts
import { Array } from "@monstermann/array";

Array.at([1, 2, 3], -1); // 3
ts
import { Array } from "@monstermann/array";

pipe([1, 2, 3], Array.at(-1)); // 3