NewDash

    Function head

    • Gets the first element of array.

      Type Parameters

      • T

      Parameters

      • array: ArrayLike<T>

        The array to query.

      Returns T

      Returns the first element of array.

      5.0.0

      first

      last

      head([1, 2, 3])
      // => 1

      head([])
      // => undefined
    MMNEPVFCICPMFPCPTTAAATR