> For the complete documentation index, see [llms.txt](https://hadeslang.gitbook.io/doc/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://hadeslang.gitbook.io/doc/language-spec/operators/logical-operators.md).

# Logical operators

## Inversion

The inversion operator (`!`) returns `true` if the operand is `false`, and `false` if the operand is `true`:

### Example

```javascript
!true //false
!false //true
```

## Logical and

The `and` or `&&` expression determines if two values are both `true`. It returns `true` if both values are `true` and `false` otherwise:

### Example

```javascript
true && false // false
true and true  // true
```

## Logical or

The `or` or `||`expression determines if either of the values (or both) are `true`. It returns `true` if one (or both) of the values are `true`.

### Example

```javascript
false or false // false
true || false  // true 
```
