Function first

  • Remarks

    Returns undefined if arr is empty.

    Example

    import * as A from "flurp/array";

    A.first([4, 5, 6]); // 4
    A.first([]); // undefined

    Type Parameters

    • T

    Parameters

    • arr: readonly T[]

    Returns undefined | T