aboutsummaryrefslogtreecommitdiff
path: root/files/zh-cn/web/javascript
diff options
context:
space:
mode:
authorFlorian Merz <me@fiji-flo.de>2021-02-08 18:35:45 +0100
committerFlorian Merz <me@fiji-flo.de>2021-02-08 18:35:45 +0100
commit0245a637604d36e2f75903a6d6f236bffd476e67 (patch)
treea2b2168a88268af7a1f1c8cce2d2e09c18ac9de9 /files/zh-cn/web/javascript
parent6b354837cbc7f718409e11da44d05d0c0668ab5e (diff)
downloadtranslated-content-0245a637604d36e2f75903a6d6f236bffd476e67.tar.gz
translated-content-0245a637604d36e2f75903a6d6f236bffd476e67.tar.bz2
translated-content-0245a637604d36e2f75903a6d6f236bffd476e67.zip
fix some more zh-cn macros
Diffstat (limited to 'files/zh-cn/web/javascript')
-rw-r--r--files/zh-cn/web/javascript/reference/global_objects/array/some/index.html9
-rw-r--r--files/zh-cn/web/javascript/reference/statements/break/index.html2
2 files changed, 1 insertions, 10 deletions
diff --git a/files/zh-cn/web/javascript/reference/global_objects/array/some/index.html b/files/zh-cn/web/javascript/reference/global_objects/array/some/index.html
index 734cace600..426e6b16a6 100644
--- a/files/zh-cn/web/javascript/reference/global_objects/array/some/index.html
+++ b/files/zh-cn/web/javascript/reference/global_objects/array/some/index.html
@@ -78,8 +78,6 @@ translation_of: Web/JavaScript/Reference/Global_Objects/Array/some
<pre class="brush: js"><code>[2, 5, 8, 1, 4].some(x =&gt; x &gt; 10); // false
[12, 5, 8, 1, 4].some(x =&gt; x &gt; 10); // true</code></pre>
-<p>{{ EmbedLiveSample('Testing_array_elements_using_arrow_functions', '', '', '', 'Web/JavaScript/Reference/Global_Objects/Array/some') }}</p>
-
<h3 id="判断数组元素中是否存在某个值">判断数组元素中是否存在某个值</h3>
<p>此例中为模仿 <code>includes()</code>  方法, 若元素在数组中存在, 则回调函数返回值为 <code>true</code> :</p>
@@ -95,8 +93,6 @@ function checkAvailability(arr, val) {
checkAvailability(fruits, 'kela'); // false
checkAvailability(fruits, 'banana'); // true</pre>
-<p>{{ EmbedLiveSample('Checking_whether_a_value_exists_in_an_array', '', '', '', 'Web/JavaScript/Reference/Global_Objects/Array/some') }}</p>
-
<h3 id="使用箭头函数判断数组元素中是否存在某个值">使用箭头函数判断数组元素中是否存在某个值</h3>
<pre class="brush: js">var fruits = ['apple', 'banana', 'mango', 'guava'];
@@ -108,9 +104,6 @@ function checkAvailability(arr, val) {
checkAvailability(fruits, 'kela'); // false
checkAvailability(fruits, 'banana'); // true</pre>
-<p>{{ EmbedLiveSample('Checking_whether_a_value_exists_using_an_arrow_function', '', '', '', 'Experiment:StaticExamplesOnTop/JavaScript/Array/some') }}</p>
-
-
<h3 id="将任意值转换为布尔类型">将任意值转换为布尔类型</h3>
@@ -134,8 +127,6 @@ getBoolean(1); // true
getBoolean('true'); // true
</pre>
-<p>{{ EmbedLiveSample('Converting_any_value_to_Boolean', '', '', '', 'Web/JavaScript/Reference/Global_Objects/Array/some') }}</p>
-
<h2 id="Compatibility" name="Compatibility">Polyfill</h2>
<p>在第 5 版时,<code>some()</code> 被添加进 ECMA-262 标准;这样导致某些实现环境可能不支持它。你可以把下面的代码插入到脚本的开头来解决此问题,从而允许在那些没有原生支持它的实现环境中使用它。该算法是 ECMA-262 第 5 版中指定的算法,假定 <code>Object </code>和 <code>TypeError</code> 拥有他们的初始值,且 <code>fun.call</code> 等价于 <code>{{jsxref("Function.prototype.call")}}</code>。</p>
diff --git a/files/zh-cn/web/javascript/reference/statements/break/index.html b/files/zh-cn/web/javascript/reference/statements/break/index.html
index 9cecd6eef9..c243fab039 100644
--- a/files/zh-cn/web/javascript/reference/statements/break/index.html
+++ b/files/zh-cn/web/javascript/reference/statements/break/index.html
@@ -17,7 +17,7 @@ translation_of: Web/JavaScript/Reference/Statements/break
<pre class="syntaxbox notranslate"><code>break [label];</code></pre>
<dl>
- <dt><code>label</code> {{可选}}</dt>
+ <dt><code>label</code></dt>
<dd>与语句标签相关联的标识符。如果 break 语句不在一个循环或 {{jsxref("Statements/switch", "switch")}} 语句中,则该项是必须的。</dd>
</dl>