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

# E0071: cannot declare 'yield' inside generator function

In non-strict mode, a variable can be named `yield`. In strict mode and inside
generator functions, it is a syntax error to use `yield` as a variable name:

```javascript-ignoring-extra-errors
function *mapRange(end, f) {
  for (let i = 0; i < end; ++i) {
    const
    yield item;
  }
}
```

To fix this error, complete the variable declaration preceeding `yield`:

```javascript
function *mapRange(f, end) {
  for (let i = 0; i < end; ++i) {
    const item = f(i);
    yield item;
  }
}
```

Introduced in quick-lint-js version 0.2.0.