Skip to content

Commit 31c354e

Browse files
ish-kafelleviding
authored andcommitted
Update article.md (javascript-tutorial#284)
* Update article.md fix code part * Update article.md
1 parent d829d9b commit 31c354e

1 file changed

Lines changed: 7 additions & 7 deletions

File tree

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

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -146,16 +146,16 @@ alert( 0 === false ); // false,比较不同类型的值
146146
当使用严格相等 `===` 比较二者时:
147147
它们是不相等的,因为它们属于不同的类型。
148148

149-
```js run
150-
alert( null === undefined ); // false
151-
```
149+
```js run
150+
alert( null === undefined ); // false
151+
```
152152

153153
当使用非严格相等 `==` 比较二者时:
154154
JavaScript 存在一个专属的规则,会判定它们互等。而它们就像“一对恋人”,仅仅等于(非严格相等下)对方而不等于其他任何的值。
155155

156-
```js run
157-
alert( null == undefined ); // true
158-
```
156+
```js run
157+
alert( null == undefined ); // true
158+
```
159159

160160
当使用数学式或其他比较方法 `< > <= >=` 时:
161161
`null/undefined` 的值会被转换为数字:`null` 转为 `0``undefined` 转为 `NaN`
@@ -178,7 +178,7 @@ alert( null >= 0 ); // (3) *!*true*/!*
178178

179179
另一方面,`undefined``null` 在相等性检测 `==` 中不会进行任何的类型转换,它们有自己独立的比较规则,所以除了它们之间互等外不会等于任何其他的值。这就解释了为什么(2)中 `null == 0` 会返回 false。
180180

181-
###“拒不合作”的 undefined
181+
### “拒不合作”的 undefined
182182

183183
`undefined` 不应该参与任何值的比较:
184184

0 commit comments

Comments
 (0)