common-stuff
    Preparing search index...

    Function dropWhile

    • Drops leading elements as long as predicate returns truthy, then yields the rest. Preserves the input container type.

      Async predicate or AsyncIterable input wraps the result in a Promise (or AsyncIterable for AsyncIterable input).

      Type Parameters

      • V

      Parameters

      • input: V[]
      • predicate: (value: V, index: number) => Promise<boolean>

      Returns Promise<V[]>

      dropWhile([1, 2, 3, 1], v => v < 3)      // [3, 1]
      dropWhile({ a: 1, b: 2, c: 3 }, ([, v]) => v < 2)
      // { b: 2, c: 3 }
    • Drops leading elements as long as predicate returns truthy, then yields the rest. Preserves the input container type.

      Async predicate or AsyncIterable input wraps the result in a Promise (or AsyncIterable for AsyncIterable input).

      Type Parameters

      • V

      Parameters

      • input: V[]
      • predicate: (value: V, index: number) => boolean

      Returns V[]

      dropWhile([1, 2, 3, 1], v => v < 3)      // [3, 1]
      dropWhile({ a: 1, b: 2, c: 3 }, ([, v]) => v < 2)
      // { b: 2, c: 3 }
    • Drops leading elements as long as predicate returns truthy, then yields the rest. Preserves the input container type.

      Async predicate or AsyncIterable input wraps the result in a Promise (or AsyncIterable for AsyncIterable input).

      Type Parameters

      • K
      • V

      Parameters

      • input: Map<K, V>
      • predicate: (value: [K, V], index: number) => boolean

      Returns Map<K, V>

      dropWhile([1, 2, 3, 1], v => v < 3)      // [3, 1]
      dropWhile({ a: 1, b: 2, c: 3 }, ([, v]) => v < 2)
      // { b: 2, c: 3 }
    • Drops leading elements as long as predicate returns truthy, then yields the rest. Preserves the input container type.

      Async predicate or AsyncIterable input wraps the result in a Promise (or AsyncIterable for AsyncIterable input).

      Type Parameters

      • T

      Parameters

      • input: Set<T>
      • predicate: (value: T, index: number) => boolean

      Returns Set<T>

      dropWhile([1, 2, 3, 1], v => v < 3)      // [3, 1]
      dropWhile({ a: 1, b: 2, c: 3 }, ([, v]) => v < 2)
      // { b: 2, c: 3 }
    • Drops leading elements as long as predicate returns truthy, then yields the rest. Preserves the input container type.

      Async predicate or AsyncIterable input wraps the result in a Promise (or AsyncIterable for AsyncIterable input).

      Type Parameters

      • T

      Parameters

      • input: AsyncIterable<T>
      • predicate: (value: T, index: number) => boolean | Promise<boolean>

      Returns AsyncIterable<T>

      dropWhile([1, 2, 3, 1], v => v < 3)      // [3, 1]
      dropWhile({ a: 1, b: 2, c: 3 }, ([, v]) => v < 2)
      // { b: 2, c: 3 }
    • Drops leading elements as long as predicate returns truthy, then yields the rest. Preserves the input container type.

      Async predicate or AsyncIterable input wraps the result in a Promise (or AsyncIterable for AsyncIterable input).

      Type Parameters

      • T

      Parameters

      • input: Iterable<T>
      • predicate: (value: T, index: number) => boolean

      Returns Iterable<T>

      dropWhile([1, 2, 3, 1], v => v < 3)      // [3, 1]
      dropWhile({ a: 1, b: 2, c: 3 }, ([, v]) => v < 2)
      // { b: 2, c: 3 }
    • Drops leading elements as long as predicate returns truthy, then yields the rest. Preserves the input container type.

      Async predicate or AsyncIterable input wraps the result in a Promise (or AsyncIterable for AsyncIterable input).

      Type Parameters

      • K extends PropertyKey
      • V

      Parameters

      • input: Record<K, V>
      • predicate: (value: [K, V], index: number) => boolean

      Returns Partial<Record<K, V>>

      dropWhile([1, 2, 3, 1], v => v < 3)      // [3, 1]
      dropWhile({ a: 1, b: 2, c: 3 }, ([, v]) => v < 2)
      // { b: 2, c: 3 }