aboutsummaryrefslogtreecommitdiff
path: root/files/zh-cn/web/javascript/reference/operators/logical_or
diff options
context:
space:
mode:
authorIrvin <irvinfly@gmail.com>2022-02-16 02:02:49 +0800
committerIrvin <irvinfly@gmail.com>2022-02-16 02:35:54 +0800
commit01b0e12ba27b5069248fd09235e9a7143915ee30 (patch)
tree0e9edf538dc3fa3331e1dbb79239b58186765f86 /files/zh-cn/web/javascript/reference/operators/logical_or
parent6ca84f1794af830ada9736d7289ce29aabb04ca3 (diff)
downloadtranslated-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/operators/logical_or')
-rw-r--r--files/zh-cn/web/javascript/reference/operators/logical_or/index.html20
1 files changed, 10 insertions, 10 deletions
diff --git a/files/zh-cn/web/javascript/reference/operators/logical_or/index.html b/files/zh-cn/web/javascript/reference/operators/logical_or/index.html
index 1a8f881377..3604b99140 100644
--- a/files/zh-cn/web/javascript/reference/operators/logical_or/index.html
+++ b/files/zh-cn/web/javascript/reference/operators/logical_or/index.html
@@ -13,7 +13,7 @@ translation_of: Web/JavaScript/Reference/Operators/Logical_OR
<h2 id="语法">语法</h2>
-<pre class="syntaxbox notranslate"><em>expr1</em> || <em>expr2</em>
+<pre class="syntaxbox"><em>expr1</em> || <em>expr2</em>
</pre>
<h2 id="Description">Description</h2>
@@ -42,7 +42,7 @@ translation_of: Web/JavaScript/Reference/Operators/Logical_OR
<p>Short circuit means that the <code><em>expr</em></code> part above is <strong>not evaluated</strong>, hence any side effects of doing so do not take effect (e.g., if <code><em>expr</em></code> is a function call, the calling never takes place). This happens because the value of the operator is already determined after the evaluation of the first operand. See example:</p>
-<pre class="brush: js notranslate">function A(){ console.log('called A'); return false; }
+<pre class="brush: js">function A(){ console.log('called A'); return false; }
function B(){ console.log('called B'); return true; }
console.log( B() || A() );
@@ -54,7 +54,7 @@ console.log( B() || A() );
<p>The following expressions might seem equivalent, but they are not, because the <code>&amp;&amp;</code> operator is executed before the <code>||</code> operator (see <a href="/en-US/docs/Web/JavaScript/Reference/Operators/Operator_Precedence">operator precedence</a>).</p>
-<pre class="brush: js notranslate">true || false &amp;&amp; false // returns true, because &amp;&amp; is executed first
+<pre class="brush: js">true || false &amp;&amp; false // returns true, because &amp;&amp; is executed first
(true || false) &amp;&amp; false // returns false, because operator precedence cannot apply</pre>
<h2 id="Examples">Examples</h2>
@@ -63,7 +63,7 @@ console.log( B() || A() );
<p>The following code shows examples of the <code>||</code> (logical OR) operator.</p>
-<pre class="brush: js notranslate">o1 = true || true // t || t returns true
+<pre class="brush: js">o1 = true || true // t || t returns true
o2 = false || true // f || t returns true
o3 = true || false // t || f returns true
o4 = false || (3 == 4) // f || f returns false
@@ -85,21 +85,21 @@ o10 = false || varObject // f || object returns varObject
<p>The following operation involving <strong>booleans</strong>:</p>
-<pre class="brush: js notranslate">bCondition1 &amp;&amp; bCondition2</pre>
+<pre class="brush: js">bCondition1 &amp;&amp; bCondition2</pre>
<p>is always equal to:</p>
-<pre class="brush: js notranslate">!(!bCondition1 || !bCondition2)</pre>
+<pre class="brush: js">!(!bCondition1 || !bCondition2)</pre>
<h4 id="Converting_OR_to_AND">Converting OR to AND</h4>
<p>The following operation involving <strong>booleans</strong>:</p>
-<pre class="brush: js notranslate">bCondition1 || bCondition2</pre>
+<pre class="brush: js">bCondition1 || bCondition2</pre>
<p>is always equal to:</p>
-<pre class="brush: js notranslate">!(!bCondition1 &amp;&amp; !bCondition2)</pre>
+<pre class="brush: js">!(!bCondition1 &amp;&amp; !bCondition2)</pre>
<h3 id="Removing_nested_parentheses">Removing nested parentheses</h3>
@@ -107,11 +107,11 @@ o10 = false || varObject // f || object returns varObject
<p>The following composite operation involving <strong>booleans</strong>:</p>
-<pre class="brush: js notranslate">bCondition1 &amp;&amp; (bCondition2 || bCondition3)</pre>
+<pre class="brush: js">bCondition1 &amp;&amp; (bCondition2 || bCondition3)</pre>
<p>is always equal to:</p>
-<pre class="brush: js notranslate">!(!bCondition1 || !bCondition2 &amp;&amp; !bCondition3)</pre>
+<pre class="brush: js">!(!bCondition1 || !bCondition2 &amp;&amp; !bCondition3)</pre>
<h2 id="Specifications">Specifications</h2>