ReviseAlgo Logo

Advanced Types

Indexed Access Types

Master Indexed Access Types (T[K]) in TypeScript, extracting nested property types, array element types, and union key lookups.

Last Updated: July 29, 2026 10 min read

An Indexed Access Type (also known as a Lookup Type) allows you to look up the exact type of a specific property on another type using bracket notation Type[Key].

1. Syntax for Indexed Access Types

Basic Property Extraction

2. Union Indexing (keyof)

Indexing with a union of keys extracts a union of the corresponding property types:

3. Extracting Array Element Types (T[number])

You can extract the element type of an array or tuple by indexing with the number keyword or a numeric index:

4. Interactive Code Playground

Test indexed access types below:

5. Summary Table

Lookup ExpressionTarget TypeResult
Type["prop"]Object TypeType of property "prop"
Type[keyof Type]Object TypeUnion of all property value types
ArrayType[number]Array Type T[]Element type T
| TupleType[0] | Tuple [A, B] | First element type A |