diff options
author | Irvin <irvinfly@gmail.com> | 2022-02-16 02:02:49 +0800 |
---|---|---|
committer | Irvin <irvinfly@gmail.com> | 2022-02-16 02:35:54 +0800 |
commit | 01b0e12ba27b5069248fd09235e9a7143915ee30 (patch) | |
tree | 0e9edf538dc3fa3331e1dbb79239b58186765f86 /files/zh-cn/web/javascript/reference/global_objects/set | |
parent | 6ca84f1794af830ada9736d7289ce29aabb04ca3 (diff) | |
download | translated-content-01b0e12ba27b5069248fd09235e9a7143915ee30.tar.gz translated-content-01b0e12ba27b5069248fd09235e9a7143915ee30.tar.bz2 translated-content-01b0e12ba27b5069248fd09235e9a7143915ee30.zip |
remove `notranslate` class in zh-CN
Diffstat (limited to 'files/zh-cn/web/javascript/reference/global_objects/set')
6 files changed, 17 insertions, 17 deletions
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 <h2 id="Syntax">Syntax</h2> -<pre class="syntaxbox notranslate"><code><em>mySet</em>[Symbol.iterator]</code></pre> +<pre class="syntaxbox"><code><em>mySet</em>[Symbol.iterator]</code></pre> <h3 id="Return_value">Return value</h3> @@ -29,7 +29,7 @@ translation_of: Web/JavaScript/Reference/Global_Objects/Set/@@iterator <h3 id="Using_iterator">Using <code>[@@iterator]()</code></h3> -<pre class="brush:js notranslate">const mySet = new Set(); +<pre class="brush:js">const mySet = new Set(); mySet.add('0'); mySet.add(1); mySet.add({}); @@ -43,7 +43,7 @@ console.log(setIter.next().value); // Object <h3 id="Using_iterator_with_for..of">Using <code>[@@iterator]()</code> with <code>for..of</code></h3> -<pre class="brush:js notranslate">const mySet = new Set(); +<pre class="brush:js">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 <p>species 属性返回默认的构造函数, 它是<code>Set</code> 对象的构造函数:</p> -<pre class="brush: js notranslate">Set[Symbol.species]; // function Set()</pre> +<pre class="brush: js">Set[Symbol.species]; // function Set()</pre> <h3 id="派生对象中的_Species">派生对象中的 Species</h3> <p>在一个派生集合对象中 (比如你自定义的<code>MySet</code>集合), <code>MySet</code> 的species 属性 是 <code>MySet</code> 构造函数. 又或者, 你想要重写它, 让它能在你派生的类方法中能返回父级<code>Set</code> 对象:</p> -<pre class="brush: js notranslate">class MySet extends Set { +<pre class="brush: js">class MySet extends Set { // Overwrite MySet species to the parent Set constructor static get [Symbol.species]() { return Set; } }</pre> 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 <h2 id="Syntax" name="Syntax">语法</h2> -<pre class="syntaxbox notranslate"><code><em>mySet</em>.add(value);</code></pre> +<pre class="syntaxbox"><code><em>mySet</em>.add(value);</code></pre> <h3 id="参数">参数</h3> @@ -37,7 +37,7 @@ translation_of: Web/JavaScript/Reference/Global_Objects/Set/add <h2 id="Examples" name="Examples">示例</h2> -<pre class="brush: js notranslate">var mySet = new Set(); +<pre class="brush: js">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 <h3 id="使用Set对象">使用<code>Set</code>对象</h3> -<pre class="brush: js notranslate">let mySet = new Set(); +<pre class="brush: js">let mySet = new Set(); mySet.add(1); // Set [ 1 ] mySet.add(5); // Set [ 1, 5 ] @@ -102,7 +102,7 @@ console.log(mySet); <h3 id="迭代Set">迭代Set</h3> -<pre class="brush: js notranslate">// 迭代整个set +<pre class="brush: js">// 迭代整个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) { <h3 id="实现基本集合操作">实现基本集合操作</h3> -<pre class="brush: js notranslate">function isSuperset(set, subset) { +<pre class="brush: js">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] <h3 id="Array_相关"> <code>Array</code> 相关</h3> -<pre class="brush: js notranslate">let myArray = ["value1", "value2", "value3"]; +<pre class="brush: js">let myArray = ["value1", "value2", "value3"]; // 用Set构造器将Array转换为Set let mySet = new Set(myArray); @@ -221,7 +221,7 @@ console.log([...mySet]); // 与myArray完全一致 <h3 id="数组去重">数组去重</h3> -<pre class="brush: js notranslate">// Use to remove duplicate elements from the array +<pre class="brush: js">// 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)]) <h3 id="String_相关"><code>String</code> 相关</h3> -<pre class="brush: js notranslate">let text = 'India'; +<pre class="brush: js">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 <h2 id="Syntax">Syntax</h2> -<pre class="syntaxbox notranslate">new Set([<var>iterable</var>])</pre> +<pre class="syntaxbox">new Set([<var>iterable</var>])</pre> <h3 id="Parameters">Parameters</h3> @@ -36,7 +36,7 @@ translation_of: Web/JavaScript/Reference/Global_Objects/Set/Set <h3 id="Using_the_Set_object">Using the <code>Set</code> object</h3> -<pre class="brush: js notranslate">let mySet = new Set() +<pre class="brush: js">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 <h2 id="语法">语法</h2> -<pre class="syntaxbox notranslate"><code><em>mySet</em>.values(); +<pre class="syntaxbox"><code><em>mySet</em>.values(); </code></pre> <h3 id="返回值">返回值</h3> @@ -33,7 +33,7 @@ translation_of: Web/JavaScript/Reference/Global_Objects/Set/values <h3 id="使用_values">使用 <code>values()</code></h3> -<pre class="brush:js notranslate">var mySet = new Set(); +<pre class="brush:js">var mySet = new Set(); mySet.add('foo'); mySet.add('bar'); mySet.add('baz'); |