UNPKG

@monstermann/fn

Version:

A utility library for TypeScript.

22 lines (20 loc) 339 B
import { dfdlT } from "@monstermann/dfdl"; //#region src/array/at.ts /** * `at(array, offset)` * * Returns the value at the specified `offset`. * * ```ts * at([1, 2, 3], -1); // 3 * ``` * * ```ts * pipe([1, 2, 3], at(-1)); // 3 * ``` */ const at = dfdlT((target, offset) => { return target.at(offset); }, 2); //#endregion export { at };