We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 64b77fb commit adb5089Copy full SHA for adb5089
RuleDocumentation/PossibleIncorrectComparisonWithNull.md
@@ -41,6 +41,7 @@ function Test-CompareWithNull
41
## Try it Yourself
42
43
``` PowerShell
44
-if (@() -eq $null) { 'true' } else { 'false' } # Returns false
45
-if ($null -ne @()) { 'true' } else { 'false' } # Returns true
+# Both expressions below return 'false' because the comparison does not return an object and therefore the if statement always falls through:
+if (@() -eq $null) { 'true' }else { 'false' }
46
+if (@() -ne $null) { 'true' }else { 'false' }
47
```
0 commit comments