From 66840d0d568dc664f9f7c8228c20d90c7566ab2d Mon Sep 17 00:00:00 2001 From: CC2m2 <61456600+CC2m2@users.noreply.github.com> Date: Mon, 30 Aug 2021 19:25:49 +0800 Subject: Update index.html --- files/zh-cn/web/javascript/reference/template_literals/index.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'files/zh-cn/web/javascript/reference') diff --git a/files/zh-cn/web/javascript/reference/template_literals/index.html b/files/zh-cn/web/javascript/reference/template_literals/index.html index 33fb6ebe53..e16b62d850 100644 --- a/files/zh-cn/web/javascript/reference/template_literals/index.html +++ b/files/zh-cn/web/javascript/reference/template_literals/index.html @@ -171,13 +171,13 @@ tag`string text line 1 \n string text line 2`;

另外,使用{{jsxref("String.raw()")}} 方法创建原始字符串和使用默认模板函数和字符串连接创建是一样的。

var str = String.raw`Hi\n${2+3}!`;
-// "Hi\n5!"
+// "Hi\\n5!"
 
 str.length;
 // 6
 
 str.split('').join(',');
-// "H,i,\,n,5,!"
+// "H,i,\\,n,5,!"
 

带标签的模版字面量及转义序列

-- cgit v1.2.3-54-g00ecf From 9ceaac7aeac286b2795f31fbd1cd3d03258aad7c Mon Sep 17 00:00:00 2001 From: CC2m2 <61456600+CC2m2@users.noreply.github.com> Date: Mon, 30 Aug 2021 19:15:59 +0800 Subject: Update index.html --- .../web/javascript/reference/global_objects/string/raw/index.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'files/zh-cn/web/javascript/reference') diff --git a/files/zh-cn/web/javascript/reference/global_objects/string/raw/index.html b/files/zh-cn/web/javascript/reference/global_objects/string/raw/index.html index 8ff8794000..989a78f2c6 100644 --- a/files/zh-cn/web/javascript/reference/global_objects/string/raw/index.html +++ b/files/zh-cn/web/javascript/reference/global_objects/string/raw/index.html @@ -55,10 +55,10 @@ String.raw`templateString`

使用 String.raw()

String.raw`Hi\n${2+3}!`;
-// 'Hi\n5!',Hi 后面的字符不是换行符,\ 和 n 是两个不同的字符
+// 'Hi\\n5!',Hi 后面的字符不是换行符,\ 和 n 是两个不同的字符
 
 String.raw `Hi\u000A!`;
-// "Hi\u000A!",同上,这里得到的会是 \、u、0、0、0、A 6个字符,
+// "Hi\\u000A!",同上,这里得到的会是 \、u、0、0、0、A 6个字符,
 // 任何类型的转义形式都会失效,保留原样输出,不信你试试.length
 
 let name = "Bob";
-- 
cgit v1.2.3-54-g00ecf


From 0c98a8a92bcdfddae7fcf277659f59085351d644 Mon Sep 17 00:00:00 2001
From: Kevin CHEN <33132228+KevinZonda@users.noreply.github.com>
Date: Sat, 4 Sep 2021 16:06:59 +0100
Subject: Fix example link in
 Web/JavaScript/Reference/Global_Objects/Object/seal, zh-CN (#2317)

fix #106
---
 .../web/javascript/reference/global_objects/object/seal/index.html      | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

(limited to 'files/zh-cn/web/javascript/reference')

diff --git a/files/zh-cn/web/javascript/reference/global_objects/object/seal/index.html b/files/zh-cn/web/javascript/reference/global_objects/object/seal/index.html
index 7a18ee2e91..6fd23f3d1d 100644
--- a/files/zh-cn/web/javascript/reference/global_objects/object/seal/index.html
+++ b/files/zh-cn/web/javascript/reference/global_objects/object/seal/index.html
@@ -14,7 +14,7 @@ translation_of: Web/JavaScript/Reference/Global_Objects/Object/seal
 
 
-
{{EmbedInteractiveExample("pages/js/object-prototype-seal.html")}}
+
{{EmbedInteractiveExample("pages/js/object-seal.html")}}
-- cgit v1.2.3-54-g00ecf