From 221577312116b41a276d2f466a5b4d12c9020e27 Mon Sep 17 00:00:00 2001 From: ConradZhangcong Date: Tue, 16 Nov 2021 15:55:20 +0800 Subject: [PATCH] Update string-methods.md --- docs/string-methods.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/string-methods.md b/docs/string-methods.md index 64333e4..2fc48b4 100644 --- a/docs/string-methods.md +++ b/docs/string-methods.md @@ -443,8 +443,8 @@ str.replaceAll(regex, replacer) ```javascript const str = 'hello'; -str.at[1] // "e" -str.at[-1] // "o" +str.at(1) // "e" +str.at(-1) // "o" ``` 如果参数位置超出了字符串范围,`at()`返回`undefined`。