# In TS, why number[][number] === number?

## Issue

```
type Test = number[][number]; // Test will be inferred to 'number' as the above image show.
```

Why `number[]`

is an index signature type with signature ‘number’?

## Solution

That’s a way how you get union of types of values.

it is the same as: there is an array of numbers `number[]`

, we say `[number]`

, that means give us a union of types of values that belong to numeric key, because it’s an array of numbers the result is `number`

.

```
type TestObject = {
test1: string;
test2: number;
};
// union of all keys is string | number
type TestValueUnion = TestObject[keyof TestObject];
// 'test1' | 'test2'
type TestKeyUnion = keyof TestObject;
```

Answered By – satanTime

**This Answer collected from stackoverflow, is licensed under cc by-sa 2.5 , cc by-sa 3.0 and cc by-sa 4.0 **