From 01b0e12ba27b5069248fd09235e9a7143915ee30 Mon Sep 17 00:00:00 2001 From: Irvin Date: Wed, 16 Feb 2022 02:02:49 +0800 Subject: remove `notranslate` class in zh-CN --- .../reference/global_objects/set/@@iterator/index.html | 6 +++--- .../reference/global_objects/set/@@species/index.html | 4 ++-- .../javascript/reference/global_objects/set/add/index.html | 4 ++-- .../web/javascript/reference/global_objects/set/index.html | 12 ++++++------ .../javascript/reference/global_objects/set/set/index.html | 4 ++-- .../reference/global_objects/set/values/index.html | 4 ++-- 6 files changed, 17 insertions(+), 17 deletions(-) (limited to 'files/zh-cn/web/javascript/reference/global_objects/set') diff --git a/files/zh-cn/web/javascript/reference/global_objects/set/@@iterator/index.html b/files/zh-cn/web/javascript/reference/global_objects/set/@@iterator/index.html index fa3f7c61e5..8ab98bf9ee 100644 --- a/files/zh-cn/web/javascript/reference/global_objects/set/@@iterator/index.html +++ b/files/zh-cn/web/javascript/reference/global_objects/set/@@iterator/index.html @@ -19,7 +19,7 @@ translation_of: Web/JavaScript/Reference/Global_Objects/Set/@@iterator

Syntax

-
mySet[Symbol.iterator]
+
mySet[Symbol.iterator]

Return value

@@ -29,7 +29,7 @@ translation_of: Web/JavaScript/Reference/Global_Objects/Set/@@iterator

Using [@@iterator]()

-
const mySet = new Set();
+
const mySet = new Set();
 mySet.add('0');
 mySet.add(1);
 mySet.add({});
@@ -43,7 +43,7 @@ console.log(setIter.next().value); // Object
 
 

Using [@@iterator]() with for..of

-
const mySet = new Set();
+
const mySet = new Set();
 mySet.add('0');
 mySet.add(1);
 mySet.add({});
diff --git a/files/zh-cn/web/javascript/reference/global_objects/set/@@species/index.html b/files/zh-cn/web/javascript/reference/global_objects/set/@@species/index.html
index c950ccbf5a..c8da916aac 100644
--- a/files/zh-cn/web/javascript/reference/global_objects/set/@@species/index.html
+++ b/files/zh-cn/web/javascript/reference/global_objects/set/@@species/index.html
@@ -21,13 +21,13 @@ translation_of: Web/JavaScript/Reference/Global_Objects/Set/@@species
 
 

species 属性返回默认的构造函数, 它是Set 对象的构造函数:

-
Set[Symbol.species]; // function Set()
+
Set[Symbol.species]; // function Set()

派生对象中的 Species

在一个派生集合对象中 (比如你自定义的MySet集合),  MySet 的species 属性 是 MySet 构造函数. 又或者, 你想要重写它, 让它能在你派生的类方法中能返回父级Set 对象:

-
class MySet extends Set {
+
class MySet extends Set {
   // Overwrite MySet species to the parent Set constructor
   static get [Symbol.species]() { return Set; }
 }
diff --git a/files/zh-cn/web/javascript/reference/global_objects/set/add/index.html b/files/zh-cn/web/javascript/reference/global_objects/set/add/index.html index 255379d70c..dac50ccb29 100644 --- a/files/zh-cn/web/javascript/reference/global_objects/set/add/index.html +++ b/files/zh-cn/web/javascript/reference/global_objects/set/add/index.html @@ -20,7 +20,7 @@ translation_of: Web/JavaScript/Reference/Global_Objects/Set/add

语法

-
mySet.add(value);
+
mySet.add(value);

参数

@@ -37,7 +37,7 @@ translation_of: Web/JavaScript/Reference/Global_Objects/Set/add

示例

-
var mySet = new Set();
+
var mySet = new Set();
 
 mySet.add(1);
 mySet.add(5).add("some text"); // 可以链式调用
diff --git a/files/zh-cn/web/javascript/reference/global_objects/set/index.html b/files/zh-cn/web/javascript/reference/global_objects/set/index.html
index 3e8c53dc64..682edbc181 100644
--- a/files/zh-cn/web/javascript/reference/global_objects/set/index.html
+++ b/files/zh-cn/web/javascript/reference/global_objects/set/index.html
@@ -71,7 +71,7 @@ translation_of: Web/JavaScript/Reference/Global_Objects/Set
 
 

使用Set对象

-
let mySet = new Set();
+
let mySet = new Set();
 
 mySet.add(1); // Set [ 1 ]
 mySet.add(5); // Set [ 1, 5 ]
@@ -102,7 +102,7 @@ console.log(mySet);
 
 

迭代Set

-
// 迭代整个set
+
// 迭代整个set
 // 按顺序输出:1, "some text", {"a": 1, "b": 2}, {"a": 1, "b": 2}
 for (let item of mySet) console.log(item);
 
@@ -147,7 +147,7 @@ mySet.forEach(function(value) {
 
 

实现基本集合操作

-
function isSuperset(set, subset) {
+
function isSuperset(set, subset) {
     for (let elem of subset) {
         if (!set.has(elem)) {
             return false;
@@ -208,7 +208,7 @@ difference(setA, setC);          // => Set [1, 2]
 
 

 Array 相关

-
let myArray = ["value1", "value2", "value3"];
+
let myArray = ["value1", "value2", "value3"];
 
 // 用Set构造器将Array转换为Set
 let mySet = new Set(myArray);
@@ -221,7 +221,7 @@ console.log([...mySet]); // 与myArray完全一致
 
 

数组去重

-
// Use to remove duplicate elements from the array
+
// Use to remove duplicate elements from the array
 const numbers = [2,3,4,4,2,3,3,4,4,5,5,6,6,7,5,32,3,4,5]
 console.log([...new Set(numbers)])
 // [2, 3, 4, 5, 6, 7, 32]
@@ -229,7 +229,7 @@ console.log([...new Set(numbers)])
 
 

String 相关

-
let text = 'India';
+
let text = 'India';
 
 let mySet = new Set(text);  // Set {'I', 'n', 'd', 'i', 'a'}
 mySet.size;  // 5
diff --git a/files/zh-cn/web/javascript/reference/global_objects/set/set/index.html b/files/zh-cn/web/javascript/reference/global_objects/set/set/index.html
index a3ae2c0278..7a19f9526a 100644
--- a/files/zh-cn/web/javascript/reference/global_objects/set/set/index.html
+++ b/files/zh-cn/web/javascript/reference/global_objects/set/set/index.html
@@ -18,7 +18,7 @@ translation_of: Web/JavaScript/Reference/Global_Objects/Set/Set
 
 

Syntax

-
new Set([iterable])
+
new Set([iterable])

Parameters

@@ -36,7 +36,7 @@ translation_of: Web/JavaScript/Reference/Global_Objects/Set/Set

Using the Set object

-
let mySet = new Set()
+
let mySet = new Set()
 
 mySet.add(1)           // Set [ 1 ]
 mySet.add(5)           // Set [ 1, 5 ]
diff --git a/files/zh-cn/web/javascript/reference/global_objects/set/values/index.html b/files/zh-cn/web/javascript/reference/global_objects/set/values/index.html
index 846bd7421d..e8a5f552e6 100644
--- a/files/zh-cn/web/javascript/reference/global_objects/set/values/index.html
+++ b/files/zh-cn/web/javascript/reference/global_objects/set/values/index.html
@@ -22,7 +22,7 @@ translation_of: Web/JavaScript/Reference/Global_Objects/Set/values
 
 

语法

-
mySet.values();
+
mySet.values();
 

返回值

@@ -33,7 +33,7 @@ translation_of: Web/JavaScript/Reference/Global_Objects/Set/values

使用 values()

-
var mySet = new Set();
+
var mySet = new Set();
 mySet.add('foo');
 mySet.add('bar');
 mySet.add('baz');
-- 
cgit v1.2.3-54-g00ecf