Skip to content

Commit 53242cb

Browse files
authored
Edit typos in article.md
1 parent 3f9fecf commit 53242cb

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

1-js/02-first-steps/08-comparison/article.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ Yeah, mathematically that's strange. The last result states that "`null` is equa
178178

179179
The reason is that an equality check `==` and comparisons `> < >= <=` work differently. Comparisons convert `null` to a number, hence treat it as `0`. That's why (3) `null >= 0` is true and (1) `null > 0` is false.
180180

181-
From the other hand, the equality check `==` for `undefined` and `null` works by the rule, without any conversions. They equal each other and don't equal anything else. That's why (2) `null == 0` is false.
181+
On the other hand, the equality check `==` for `undefined` and `null` works by the rule, without any conversions. They equal each other and don't equal anything else. That's why (2) `null == 0` is false.
182182

183183
### An incomparable undefined
184184

@@ -192,7 +192,7 @@ alert( undefined == 0 ); // false (3)
192192

193193
Why does it dislike a zero so much? Always false!
194194

195-
We've got such result, because:
195+
We've got these results because:
196196

197197
- Comparisons `(1)` and `(2)` return `false` because `undefined` gets converted to `NaN`. And `NaN` is a special numeric value which returns `false` for all comparisons.
198198
- The equality check `(3)` returns `false`, because `undefined` only equals `null` and no other value.
@@ -201,7 +201,7 @@ We've got such result, because:
201201

202202
Why did we observe these examples? Should we remember these pecularities all the time? Well, not really. Actually, these tricky things will gradually become familiar over the time, but there's a solid way to evade any problems with them.
203203

204-
Just treat any comparison with `undefined/null` except the strict equality `===` with an exceptional care.
204+
Just treat any comparison with `undefined/null` except the strict equality `===` with exceptional care.
205205

206206
Don't use comparisons `>= > < <=` with a variable which may be `null/undefined`, unless you are really sure what you're doing. If a variable can have such values, then check for them separately.
207207

0 commit comments

Comments
 (0)