Options
All
  • Public
  • Public/Protected
  • All
Menu

Module first

Index

References

Functions Array

References

Renames and re-exports first

Array Functions

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

    since

    5.5.0

    see

    head

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

    first([]);
    // => undefined

    Type parameters

    • T

    Parameters

    • array: ArrayLike<T>

      The array to query.

    Returns T | undefined

    Returns the first element of array.