source: node_modules/es-toolkit/dist/compat/array/takeRight.d.ts@ a762898

Last change on this file since a762898 was a762898, checked in by istevanoska <ilinastevanoska@…>, 5 months ago

Added visualizations

  • Property mode set to 100644
File size: 607 bytes
Line 
1/**
2 * Creates a slice of array with n elements taken from the end.
3 *
4 * @template T
5 * @param {ArrayLike<T> | null | undefined} array - The array to query.
6 * @param {number} [n=1] - The number of elements to take.
7 * @returns {T[]} Returns the slice of array.
8 *
9 * @example
10 * takeRight([1, 2, 3]);
11 * // => [3]
12 *
13 * @example
14 * takeRight([1, 2, 3], 2);
15 * // => [2, 3]
16 *
17 * @example
18 * takeRight([1, 2, 3], 5);
19 * // => [1, 2, 3]
20 *
21 * @example
22 * takeRight([1, 2, 3], 0);
23 * // => []
24 */
25declare function takeRight<T>(array: ArrayLike<T> | null | undefined, n?: number): T[];
26
27export { takeRight };
Note: See TracBrowser for help on using the repository browser.