Options
All
  • Public
  • Public/Protected
  • All
Menu

Module head

Index

References

Functions Array

References

Renames and re-exports head

Array Functions

  • head<T>(array: ArrayLike<T>): T | undefined
  • Gets the first element of array.

    since

    5.0.0

    alias

    first

    see

    last

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

    head([])
    // => undefined

    Type parameters

    • T

    Parameters

    • array: ArrayLike<T>

      The array to query.

    Returns T | undefined

    Returns the first element of array.