> ## Documentation Index
> Fetch the complete documentation index at: https://docs.sourcery.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Simplify-Ternary

#### Sourcery rule id: `simplify-ternary`

#### Description

Avoid unneeded ternary statements


#### Before

```javascript
const foo = a ? a : b;
```

#### After

```javascript
const foo = a || b;
```



#### Explanation

It is possible to simplify certain ternary statements into either use of an `||` or `!`.
This makes the code easier to read, since there is no conditional logic.
