mirror of
https://github.com/apachecn/eloquent-js-3e-zh.git
synced 2025-05-23 20:02:20 +00:00
3
This commit is contained in:
parent
78e572cdf6
commit
a8c61e821c
2
3.md
2
3.md
@ -582,7 +582,7 @@ console.log(isEven(-1));
|
|||||||
// → ??
|
// → ??
|
||||||
```
|
```
|
||||||
|
|
||||||
### 3.13.3 字符计数
|
### 字符计数
|
||||||
|
|
||||||
你可以通过编写`"string"[N]`,来从字符串中得到第`N`个字符或字母。 返回的值将是只包含一个字符的字符串(例如`"b"`)。 第一个字符的位置为零,这会使最后一个字符在`string.length - 1`。 换句话说,含有两个字符的字符串的长度为2,其字符的位置为 0 和 1。
|
你可以通过编写`"string"[N]`,来从字符串中得到第`N`个字符或字母。 返回的值将是只包含一个字符的字符串(例如`"b"`)。 第一个字符的位置为零,这会使最后一个字符在`string.length - 1`。 换句话说,含有两个字符的字符串的长度为2,其字符的位置为 0 和 1。
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user