1
0
mirror of https://github.com/apachecn/eloquent-js-3e-zh.git synced 2025-05-29 16:22:22 +00:00

Update 1.md

change “A” to "a"
This commit is contained in:
文刀 2019-03-10 20:19:10 +08:00 committed by GitHub
parent 278b742ecd
commit 70f26b19ee
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

2
1.md
View File

@ -200,7 +200,7 @@ console.log("Aardvark" < "Zoroaster")
// → true
```
字符串排序的方式大致是字典序,但不真正是你期望从字典中看到的那样:大写字母总是比小写字母“小”,所以`"Z"<"A"`,非字母字符(`!``-`等)也包含在排序中。 比较字符串时JavaScript 从左向右遍历字符,逐个比较 Unicode 代码。
字符串排序的方式大致是字典序,但不真正是你期望从字典中看到的那样:大写字母总是比小写字母“小”,所以`"Z"<""`,非字母字符(`!``-`等)也包含在排序中。 比较字符串时JavaScript 从左向右遍历字符,逐个比较 Unicode 代码。
其他类似的运算符则包括`>=`(大于等于),`<=`(小于等于),`==`(等于)和`!=`(不等于)。