# Source: https://github.com/quick-lint/quick-lint-js/blob/master/docs/errors/E0003.md

# E0003: cannot assign to const variable

You cannot reassign variables declared with `const`. The assignment will crash
with a `ReferenceError` if you run the code.

In TypeScript, you cannot assign to `enum`s.

```javascript
const pi = 3.14;
pi = 6;

const friends = ["Alice"];
friends = ["Bob"];
```

To fix this error, assign to a different variable, declare a new variable with a
different name, or change `const` to `let`:

```javascript
let pi = 3.14;
pi = 6;

const friends = ["Alice"];
const acquaintances = ["Bob"];
```

Introduced in quick-lint-js version 0.2.0.