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

# E0172: missing body for function

```config-for-examples
{
  "globals": {
    "numbers": true,
    "n": true
  }
}
```

Functions declared with `function` require a body, which must `{` `}`
surrounding a list of statements. It is a syntax error to omit the body of a
function:

```javascript
function isEven(n) return n % 2 === 0;

for (let n of numbers) {
  if (isEven(n)) console.log(n);
}
```

To fix this error, write `{` after the parameter list and `}` at the end of the
function's body:

```javascript
function isEven(n) { return n % 2 === 0; }

for (let n of numbers) {
  if (isEven(n)) console.log(n);
}
```

Introduced in quick-lint-js version 0.4.0.