@monstermann/fn
Version:
A utility library for TypeScript.
20 lines • 382 B
TypeScript
//#region src/array/at.d.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
* ```
*/
declare const at: {
(offset: number): <T>(target: readonly T[]) => T | undefined;
<T>(target: readonly T[], offset: number): T | undefined;
};
//#endregion
export { at };