@nevware21/ts-utils
    Preparing search index...

    Function arrDrop

    • The arrDrop() method returns a new array with the first n elements removed from the source array. If n is greater than the array length, returns empty array. If n is negative or 0, returns all elements.

      Type Parameters

      • T

        Identifies the base type of array elements

      Parameters

      • theArray: ArrayLike<T>

        The array or array-like object to drop from

      • count: number

        The number of elements to drop from the beginning

      Returns T[]

      A new array with the first n elements removed

      0.14.0

      arrDrop([1, 2, 3, 4, 5], 2);    // [3, 4, 5]
      arrDrop(["a", "b", "c"], 1); // ["b", "c"]
      arrDrop([1, 2], 5); // []
      arrDrop([1, 2, 3], 0); // [1, 2, 3]
      arrDrop([1, 2, 3], -1); // [1, 2, 3]

      // Array-like objects
      arrDrop({ length: 4, 0: 1, 1: 2, 2: 3, 3: 4 }, 2); // [3, 4]