Skip to content

Commit 3abe008

Browse files
authored
Update Condition-Sequence.md
1 parent 4e797e2 commit 3abe008

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

Condition-Sequence.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@
33
Now we have some fruit.
44

55
```powershell
6-
$fruit = @('Apples','Oranges','Bananas')
6+
$fruits = @('Apple','Orange','Banana')
77
```
88

9-
And write a simple method:
9+
Of course, `Apple` is a fruit. Not `fruits`:
1010

1111
```powershell
12-
if ($fruit -eq 'Apples') {
12+
if ('Apple' -eq $fruits) {
1313
echo 'True!'
1414
} else {
1515
echo 'False!'
@@ -19,13 +19,13 @@ if ($fruit -eq 'Apples') {
1919
Which outputs:
2020

2121
```text
22-
True!
22+
False!
2323
```
2424

25-
But if you invert the condition:
25+
But is `$fruits` Apple?
2626

2727
```powershell
28-
if ('Apples' -eq $fruit) {
28+
if ($fruits -eq 'Apple') {
2929
echo 'True!'
3030
} else {
3131
echo 'False!'
@@ -35,7 +35,7 @@ if ('Apples' -eq $fruit) {
3535
Which outputs:
3636

3737
```text
38-
False!
38+
True!
3939
```
4040

4141
What a strange behavior of PowerShell!

0 commit comments

Comments
 (0)