source: node_modules/es-toolkit/dist/compat/array/drop.d.ts

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

Added visualizations

  • Property mode set to 100644
File size: 917 bytes
Line 
1/**
2 * Removes a specified number of elements from the beginning 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 start.
6 *
7 * @template T - The type of elements in the array.
8 * @param {ArrayLike<T> | null | undefined} collection - The array from which to drop elements.
9 * @param {number} itemsCount - The number of elements to drop from the beginning of the array.
10 * @param {unknown} [guard] - Enables use as an iteratee for methods like `_.map`.
11 * @returns {T[]} A new array with the specified number of elements removed from the start.
12 *
13 * @example
14 * const array = [1, 2, 3, 4, 5];
15 * const result = drop(array, 2);
16 * result will be [3, 4, 5] since the first two elements are dropped.
17 */
18declare function drop<T>(array: ArrayLike<T> | null | undefined, n?: number): T[];
19
20export { drop };
Note: See TracBrowser for help on using the repository browser.