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

# Dont-Negate-Is-Instanceof-Operands

#### Sourcery rule id: `dont-negate-is-instanceof-operands`

#### Description

`in` and `instanceof` have lower precedence than negation operators.


#### Match

```javascript
if (!"prop" in myObj) {  // Noncompliant;  "in" operator is checking property "false"
  doTheThing();  // this block will be never executed
}
```



#### Explanation

Since negation is applied first, checking `!key in dict` checks whether `!key` is in dict
rather than whether the `key` is not in the `dict`, and similarly with `instanceof`.

This rule warns when the left operand of `is` or `instanceof` is negated.
