> ## 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.

# Remove-Redundant-If-Statement

#### Sourcery rule id: `remove-redundant-if-statement`

#### Description

Remove an `if` statement where the condition is `true`.


#### Before

```javascript
if (true) {
  console.log("great!")
}
```

#### After

```javascript
console.log("great!")
```



#### Explanation

If the condition of an `if` statement is `true`, its body will always be executed. Conversely, if the condition
is always `false`, then its body will never be executed. In the first case, we can replace the `if` statement with
its body, and in the second case we can remove it altogether.
