# TS7015: Element implicitly has an 'any' type because index expression is not of type 'number'.

> An array is indexed with a value that isn't a number, so the element type is `any`. Index with a number, or use an object or Map.

## What it means

Under `noImplicitAny`, indexing an array or tuple with a key that isn't of type `number` (for
example a `string`) can't find an element type, so the result would be an implicit `any`.

## Example

```ts
const names = ["a", "b"];
declare const key: string;
export const n = names[key];
```

## How to fix

- Convert the key: `names[Number(key)]`.
- If you meant a lookup by name, use an object type with an index signature or a `Map`.

Source: https://ts-r.dev/errors/TS7015/
