mirror of
https://github.com/ruanyf/es6tutorial.git
synced 2025-05-29 05:42:20 +00:00
Update string-methods.md
This commit is contained in:
parent
79e871c872
commit
2215773121
@ -443,8 +443,8 @@ str.replaceAll(regex, replacer)
|
|||||||
|
|
||||||
```javascript
|
```javascript
|
||||||
const str = 'hello';
|
const str = 'hello';
|
||||||
str.at[1] // "e"
|
str.at(1) // "e"
|
||||||
str.at[-1] // "o"
|
str.at(-1) // "o"
|
||||||
```
|
```
|
||||||
|
|
||||||
如果参数位置超出了字符串范围,`at()`返回`undefined`。
|
如果参数位置超出了字符串范围,`at()`返回`undefined`。
|
||||||
|
Loading…
x
Reference in New Issue
Block a user