From f01d9533d837deb3d864dc921f81fbce3bbc9bd8 Mon Sep 17 00:00:00 2001 From: Leon Xu <6479451-leonxu260@users.noreply.gitlab.com> Date: Fri, 27 Aug 2021 13:09:35 -0700 Subject: [PATCH] fix: string convertion section --- source/_posts/JavaScript.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/_posts/JavaScript.md b/source/_posts/JavaScript.md index e26a850..9b386af 100644 --- a/source/_posts/JavaScript.md +++ b/source/_posts/JavaScript.md @@ -124,7 +124,7 @@ let name = 'Pikachu'; // can use "" or '' ``` JavaScript可以用的一些方法:[charAt](https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/String/charAt), [charCodeAt](https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/String/charCodeAt), [fromCharCode](https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/String/fromCharCode), [indexOf](https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/String/indexOf), [lastIndexOf](https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/String/lastIndexOf), [replace](https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/String/replace), [split](https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/String/split), [substring](https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/String/substring), [toLowerCase](https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/String/toLowerCase), [toUpperCase](https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/String/toUpperCase) -要访问字符串s的字符,使用s[index]或s. charat (index): +要访问字符串s的字符,使用s[index]或s.charAt(index): ```javascript let firstLetter = puppyCount[0]; // "1" let fourthLetter = puppyCount.charAt(3); // "p"