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

# E0146: missing ':' in conditional expression

```config-for-examples
{
  "globals": {
    "focus": true
  }
}
```

The `? :` ternary operator has three parts: the condition, the expression if
true, and the expression if false. It is a syntax error to omit the expression
if false:

```javascript
for (let i = 1; i <= 100; ++i) {
  console.log(i % 15 ? i);
}

document.querySelector("form input")?focus();
```

To fix this error, write `:` followed by an expression:

```javascript
for (let i = 1; i <= 100; ++i) {
  console.log(i % 15 ? i : "FizzBuzz");
}
```

Alternatively, write `?.` instead of `?` to access an object's property:

```javascript
document.querySelector("form input")?.focus();
```

Introduced in quick-lint-js version 0.2.0.