common-stuff
    Preparing search index...

    Function drop

    • Returns a new container skipping the first n elements of the input, preserving the original container type.

      Negative n is treated as 0.

      Type Parameters

      • V

      Parameters

      • input: V[]
      • n: number

      Returns V[]

      drop([1, 2, 3, 4], 2)            // [3, 4]
      drop(new Set([1, 2, 3]), 1) // Set { 2, 3 }
    • Returns a new container skipping the first n elements of the input, preserving the original container type.

      Negative n is treated as 0.

      Type Parameters

      • K
      • V

      Parameters

      • input: Map<K, V>
      • n: number

      Returns Map<K, V>

      drop([1, 2, 3, 4], 2)            // [3, 4]
      drop(new Set([1, 2, 3]), 1) // Set { 2, 3 }
    • Returns a new container skipping the first n elements of the input, preserving the original container type.

      Negative n is treated as 0.

      Type Parameters

      • T

      Parameters

      • input: Set<T>
      • n: number

      Returns Set<T>

      drop([1, 2, 3, 4], 2)            // [3, 4]
      drop(new Set([1, 2, 3]), 1) // Set { 2, 3 }
    • Returns a new container skipping the first n elements of the input, preserving the original container type.

      Negative n is treated as 0.

      Type Parameters

      • T

      Parameters

      • input: AsyncIterable<T>
      • n: number

      Returns AsyncIterable<T>

      drop([1, 2, 3, 4], 2)            // [3, 4]
      drop(new Set([1, 2, 3]), 1) // Set { 2, 3 }
    • Returns a new container skipping the first n elements of the input, preserving the original container type.

      Negative n is treated as 0.

      Type Parameters

      • T

      Parameters

      • input: Iterable<T>
      • n: number

      Returns Iterable<T>

      drop([1, 2, 3, 4], 2)            // [3, 4]
      drop(new Set([1, 2, 3]), 1) // Set { 2, 3 }
    • Returns a new container skipping the first n elements of the input, preserving the original container type.

      Negative n is treated as 0.

      Type Parameters

      • K extends PropertyKey
      • V

      Parameters

      • input: Record<K, V>
      • n: number

      Returns Partial<Record<K, V>>

      drop([1, 2, 3, 4], 2)            // [3, 4]
      drop(new Set([1, 2, 3]), 1) // Set { 2, 3 }