Skip to content

Commit 4f8e34e

Browse files
awslesbergmeister
authored andcommitted
Add example to illustrate behavior (#1220)
Add an additional "Try it Yourself" example to illustrate the behavior.
1 parent df566b5 commit 4f8e34e

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

RuleDocumentation/PossibleIncorrectComparisonWithNull.md

+7
Original file line numberDiff line numberDiff line change
@@ -37,3 +37,10 @@ function Test-CompareWithNull
3737
}
3838
}
3939
```
40+
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
46+
```

0 commit comments

Comments
 (0)