Tweakr
    Preparing search index...

    Function drop

    • Creates a slice of an array with n elements dropped from the start.

      Type Parameters

      • T

      Parameters

      • array: T[]

        The array to process.

      • n: number = 1

        The number of elements to drop from the start. Defaults to 1.

      Returns T[]

      A new array excluding the dropped elements.

      drop([1, 2, 3, 4], 2);
      // → [3, 4]

      drop([1, 2, 3]);
      // → [2, 3]

      1.0.0