From 6ca84f1794af830ada9736d7289ce29aabb04ca3 Mon Sep 17 00:00:00 2001 From: t7yang Date: Mon, 10 Jan 2022 08:38:05 +0800 Subject: remove `notranslate` class in zh-TW --- .../web/javascript/reference/global_objects/set/index.html | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'files/zh-tw/web/javascript/reference/global_objects/set/index.html') diff --git a/files/zh-tw/web/javascript/reference/global_objects/set/index.html b/files/zh-tw/web/javascript/reference/global_objects/set/index.html index 2b3f80fdd1..7875873120 100644 --- a/files/zh-tw/web/javascript/reference/global_objects/set/index.html +++ b/files/zh-tw/web/javascript/reference/global_objects/set/index.html @@ -19,7 +19,7 @@ translation_of: Web/JavaScript/Reference/Global_Objects/Set

語法

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

參數

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

使用 Set 物件

-
var mySet = new Set();
+
var mySet = new Set();
 
 mySet.add(1); // Set [ 1 ]
 mySet.add(5); // Set [ 1, 5 ]
@@ -95,7 +95,7 @@ console.log(mySet);// Set [ 1, "some text", Object {a: 1, b: 2}, Object {a: 1, b
 
 

迭代 Sets

-
// iterate over items in set
+
// iterate over items in set
 // logs the items in the order: 1, "some text", {"a": 1, "b": 2}, {"a": 1, "b": 2}
 for (let item of mySet) console.log(item);
 
@@ -139,7 +139,7 @@ mySet.forEach(function(value) {
 
 

實作基本的 set 操作

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

與 Array 物件關聯

-
var myArray = ['value1', 'value2', 'value3'];
+
var myArray = ['value1', 'value2', 'value3'];
 
 // Use the regular Set constructor to transform an Array into a Set
 var mySet = new Set(myArray);
@@ -200,7 +200,7 @@ console.log([...mySet]); // Will show you exactly the same Array as myArray
與 Strings 關聯 -
var text = 'India';
+
var text = 'India';
 
 var mySet = new Set(text);  // Set ['I', 'n', 'd', 'i', 'a']
 mySet.size;  // 5
-- 
cgit v1.2.3-54-g00ecf