Type alias Prepend<Arr, Item>

Prepend<Arr, Item>: [Item, ...Arr]

add an item to the start of a tuple.

Type Parameters

  • Arr extends unknown[]
  • Item

Example

type Result1 = Prepend<[2, 3], 1>; // [1, 2, 3]
type Result2 = Prepend<[], 1>; // [1]