Type alias Last<Input>

Last<Input>: Second<InitialAndLast<Input>>

Last value of an ArrayLike.

Remarks

Type of the last character of a string or the last element of an array.

Example

const array = ["🟢", "🟩", "💚"];
const last: Last<typeof array> = "💚";

See

Type Parameters

  • Input extends ArrayLike

    The input ArrayLike.