source: node_modules/es-toolkit/dist/compat/array/dropWhile.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: 958 bytes
RevLine 
[a762898]1import { ListIteratee } from '../_internal/ListIteratee.mjs';
2
3/**
4 * Creates a slice of array excluding elements dropped from the beginning.
5 * Elements are dropped until predicate returns falsey.
6 * The predicate is invoked with three arguments: (value, index, array).
7 *
8 * @template T - The type of elements in the array
9 * @param {ArrayLike<T> | null | undefined} arr - The array to query
10 * @param {ListIteratee<T>} [predicate=identity] - The function invoked per iteration
11 * @returns {T[]} Returns the slice of array
12 *
13 * @example
14 * dropWhile([1, 2, 3], n => n < 3)
15 * // => [3]
16 *
17 * dropWhile([{ a: 1, b: 2 }, { a: 1, b: 3 }], { a: 1 })
18 * // => [{ a: 1, b: 3 }]
19 *
20 * dropWhile([{ a: 1, b: 2 }, { a: 1, b: 3 }], ['a', 1])
21 * // => [{ a: 1, b: 3 }]
22 *
23 * dropWhile([{ a: 1, b: 2 }, { a: 1, b: 3 }], 'a')
24 * // => []
25 */
26declare function dropWhile<T>(arr: ArrayLike<T> | null | undefined, predicate?: ListIteratee<T>): T[];
27
28export { dropWhile };
Note: See TracBrowser for help on using the repository browser.