source: node_modules/es-toolkit/dist/array/dropRight.d.mts

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

Added visualizations

  • Property mode set to 100644
File size: 787 bytes
Line 
1/**
2 * Removes a specified number of elements from the end of an array and returns the rest.
3 *
4 * This function takes an array and a number, and returns a new array with the specified number
5 * of elements removed from the end.
6 *
7 * @template T - The type of elements in the array.
8 * @param {T[]} arr - The array from which to drop elements.
9 * @param {number} itemsCount - The number of elements to drop from the end of the array.
10 * @returns {T[]} A new array with the specified number of elements removed from the end.
11 *
12 * @example
13 * const array = [1, 2, 3, 4, 5];
14 * const result = dropRight(array, 2);
15 * // result will be [1, 2, 3] since the last two elements are dropped.
16 */
17declare function dropRight<T>(arr: readonly T[], itemsCount: number): T[];
18
19export { dropRight };
Note: See TracBrowser for help on using the repository browser.