@thi.ng/arrays
Version:
Array / Arraylike utilities
13 lines • 360 B
TypeScript
/**
* Returns first element of given array or `undefined` if array is empty.
*
* @param buf - array
*/
export declare const first: <T>(buf: ArrayLike<T>) => T;
/**
* Returns last element of given array or `undefined` if array is empty.
*
* @param buf - array
*/
export declare const peek: <T>(buf: ArrayLike<T>) => T;
//# sourceMappingURL=peek.d.ts.map