# TS2448: Block-scoped variable '…' used before its declaration.

> A let or const variable is read before the line that declares it. Move the declaration up, or move the use after it.

## What it means

`let` and `const` variables exist from the start of their block but can't be read until their
declaration has run (the temporal dead zone). A use that appears earlier in the same scope throws
at runtime, so it is reported.

## Example

```ts
console.log(total);
const total = 10;
```

## How to fix

- Move the declaration above its first use.
- If the use is inside a function that runs later, that's fine; this error is only for code that runs before the declaration.

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