From 95d62ea56ce3f67f38a17f5a60fbefe4236abffc Mon Sep 17 00:00:00 2001 From: ruanyf Date: Mon, 17 Jun 2019 15:28:34 +0800 Subject: [PATCH] docs(string-methods): refact String.raw() --- docs/string-methods.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/string-methods.md b/docs/string-methods.md index 863e942..318d0f7 100644 --- a/docs/string-methods.md +++ b/docs/string-methods.md @@ -43,6 +43,8 @@ String.raw`Hi\u000A!`; ```javascript String.raw`Hi\\n` // 返回 "Hi\\\\n" + +String.raw`Hi\\n` === "Hi\\\\n" // true ``` `String.raw()`方法可以作为处理模板字符串的基本方法,它会将所有变量替换,而且对斜杠进行转义,方便下一步作为字符串来使用。