Skip to content

Latest commit

 

History

History
26 lines (17 loc) · 478 Bytes

File metadata and controls

26 lines (17 loc) · 478 Bytes

Home > types-kit > ArrayItem

ArrayItem type

Get the item type from an array.

Signature:

export type ArrayItem<T extends readonly unknown[]> = T extends ReadonlyArray<
  infer Item
>
  ? Item
  : never

Example

// Expect: number
type Foo = ArrayItem<number[]>