Type alias First<Input>

First<Input>: Input[0]

First value of an ArrayLike.

Remarks

Type of the first item of an ArrayLike, mainly here to avoid magic numbers.

Example

const array = ["🟢", "🟩", "💚"];
const first: First<typeof array> = "🟢";

See

Type Parameters

  • Input extends ArrayLike

    The input ArrayLike.