# TS2450: Enum '…' used before its declaration.

> An enum member is read before the enum declaration has run. Move the enum declaration above the use.

## What it means

An enum compiles to an object that is created where the enum is declared. Reading it before that
point gets `undefined` at runtime.

## Example

```ts
export const initial = Level.Low;
enum Level {
  Low,
  High,
}
```

## How to fix

- Move the enum declaration above the first use.
- Or use a `const enum`, whose members are inlined and don't need the object at runtime.

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