DieselDepot-APP/node_modules/es-toolkit/dist/compat/array/take.d.mts
SJCoetz def597c157 chore: add generated build artifacts and node module type files
add all Next.js build outputs and third-party dependency type declaration files
2026-07-20 01:18:42 +02:00

28 lines
No EOL
582 B
TypeScript

//#region src/compat/array/take.d.ts
/**
* Creates a slice of array with n elements taken from the beginning.
*
* @template T
* @param array - The array to query.
* @param [n=1] - The number of elements to take.
* @returns Returns the slice of array.
*
* @example
* take([1, 2, 3]);
* // => [1]
*
* @example
* take([1, 2, 3], 2);
* // => [1, 2]
*
* @example
* take([1, 2, 3], 5);
* // => [1, 2, 3]
*
* @example
* take([1, 2, 3], 0);
* // => []
*/
declare function take<T>(array: ArrayLike<T> | null | undefined, n?: number): T[];
//#endregion
export { take };