aboutsummaryrefslogtreecommitdiff
path: root/files/zh-cn/web/javascript/equality_comparisons_and_sameness
diff options
context:
space:
mode:
authorIrvin <irvinfly@gmail.com>2022-02-16 02:03:27 +0800
committerIrvin <irvinfly@gmail.com>2022-02-16 02:35:54 +0800
commit012ee621791b6895e637f96e6523027951768f25 (patch)
tree29cfacc0d5092af45870dcc74f22feb8b2664fbf /files/zh-cn/web/javascript/equality_comparisons_and_sameness
parentba91b017421b001cd226135612a7bd5dfcd88904 (diff)
downloadtranslated-content-012ee621791b6895e637f96e6523027951768f25.tar.gz
translated-content-012ee621791b6895e637f96e6523027951768f25.tar.bz2
translated-content-012ee621791b6895e637f96e6523027951768f25.zip
remove inline style for zh-CN
Diffstat (limited to 'files/zh-cn/web/javascript/equality_comparisons_and_sameness')
-rw-r--r--files/zh-cn/web/javascript/equality_comparisons_and_sameness/index.html236
1 files changed, 117 insertions, 119 deletions
diff --git a/files/zh-cn/web/javascript/equality_comparisons_and_sameness/index.html b/files/zh-cn/web/javascript/equality_comparisons_and_sameness/index.html
index 5d8e0d7528..c9e1e5ae71 100644
--- a/files/zh-cn/web/javascript/equality_comparisons_and_sameness/index.html
+++ b/files/zh-cn/web/javascript/equality_comparisons_and_sameness/index.html
@@ -67,74 +67,74 @@ console.log(obj === undefined); // false
<thead>
<tr>
<th scope="row"></th>
- <th colspan="7" scope="col" style="text-align: center;">被比较值 B</th>
+ <th colspan="7" scope="col">被比较值 B</th>
</tr>
</thead>
<tbody>
<tr>
<th scope="row"></th>
<td></td>
- <td style="text-align: center;">Undefined</td>
- <td style="text-align: center;">Null</td>
- <td style="text-align: center;">Number</td>
- <td style="text-align: center;">String</td>
- <td style="text-align: center;">Boolean</td>
- <td style="text-align: center;">Object</td>
+ <td>Undefined</td>
+ <td>Null</td>
+ <td>Number</td>
+ <td>String</td>
+ <td>Boolean</td>
+ <td>Object</td>
</tr>
<tr>
<th colspan="1" rowspan="6" scope="row">被比较值 A</th>
<td>Undefined</td>
- <td style="text-align: center;"><code>true</code></td>
- <td style="text-align: center;"><code>true</code></td>
- <td style="text-align: center;"><code>false</code></td>
- <td style="text-align: center;"><code>false</code></td>
- <td style="text-align: center;"><code>false</code></td>
- <td style="text-align: center;"><code>IsFalsy(B)</code></td>
+ <td><code>true</code></td>
+ <td><code>true</code></td>
+ <td><code>false</code></td>
+ <td><code>false</code></td>
+ <td><code>false</code></td>
+ <td><code>IsFalsy(B)</code></td>
</tr>
<tr>
<td>Null</td>
- <td style="text-align: center;"><code>true</code></td>
- <td style="text-align: center;"><code>true</code></td>
- <td style="text-align: center;"><code>false</code></td>
- <td style="text-align: center;"><code>false</code></td>
- <td style="text-align: center;"><code>false</code></td>
- <td style="text-align: center;"><code>IsFalsy(B)</code></td>
+ <td><code>true</code></td>
+ <td><code>true</code></td>
+ <td><code>false</code></td>
+ <td><code>false</code></td>
+ <td><code>false</code></td>
+ <td><code>IsFalsy(B)</code></td>
</tr>
<tr>
<td>Number</td>
- <td style="text-align: center;"><code>false</code></td>
- <td style="text-align: center;"><code>false</code></td>
- <td style="text-align: center;"><code>A === B</code></td>
- <td style="text-align: center;"><code>A === ToNumber(B)</code></td>
- <td style="text-align: center;"><code>A=== ToNumber(B) </code></td>
- <td style="text-align: center;"><code>A== ToPrimitive(B)</code></td>
+ <td><code>false</code></td>
+ <td><code>false</code></td>
+ <td><code>A === B</code></td>
+ <td><code>A === ToNumber(B)</code></td>
+ <td><code>A=== ToNumber(B) </code></td>
+ <td><code>A== ToPrimitive(B)</code></td>
</tr>
<tr>
<td>String</td>
- <td style="text-align: center;"><code>false</code></td>
- <td style="text-align: center;"><code>false</code></td>
- <td style="text-align: center;"><code>ToNumber(A) === B</code></td>
- <td style="text-align: center;"><code>A === B</code></td>
- <td style="text-align: center;"><code>ToNumber(A) === ToNumber(B)</code></td>
- <td style="text-align: center;"><code>ToPrimitive(B) == A</code></td>
+ <td><code>false</code></td>
+ <td><code>false</code></td>
+ <td><code>ToNumber(A) === B</code></td>
+ <td><code>A === B</code></td>
+ <td><code>ToNumber(A) === ToNumber(B)</code></td>
+ <td><code>ToPrimitive(B) == A</code></td>
</tr>
<tr>
<td>Boolean</td>
- <td style="text-align: center;"><code>false</code></td>
- <td style="text-align: center;"><code>false</code></td>
- <td style="text-align: center;"><code>ToNumber(A) === B</code></td>
- <td style="text-align: center;"><code>ToNumber(A) === ToNumber(B)</code></td>
- <td style="text-align: center;"><code>A === B</code></td>
- <td style="text-align: center;"><code>ToNumber(A) == ToPrimitive(B)</code></td>
+ <td><code>false</code></td>
+ <td><code>false</code></td>
+ <td><code>ToNumber(A) === B</code></td>
+ <td><code>ToNumber(A) === ToNumber(B)</code></td>
+ <td><code>A === B</code></td>
+ <td><code>ToNumber(A) == ToPrimitive(B)</code></td>
</tr>
<tr>
<td>Object</td>
- <td style="text-align: center;"><code>false</code></td>
- <td style="text-align: center;"><code>false</code></td>
- <td style="text-align: center;"><code>ToPrimitive(A) == B</code></td>
- <td style="text-align: center;"><code>ToPrimitive(A) == B</code></td>
- <td style="text-align: center;"><code>ToPrimitive(A) == ToNumber(B)</code></td>
- <td style="text-align: center;">
+ <td><code>false</code></td>
+ <td><code>false</code></td>
+ <td><code>ToPrimitive(A) == B</code></td>
+ <td><code>ToPrimitive(A) == B</code></td>
+ <td><code>ToPrimitive(A) == ToNumber(B)</code></td>
+ <td>
<p><code>A === B</code></p>
</td>
</tr>
@@ -204,174 +204,174 @@ function attemptMutation(v)
<caption>判等</caption>
<thead>
<tr>
- <th scope="col" style="text-align: center;">x</th>
- <th scope="col" style="text-align: center;">y</th>
- <th scope="col" style="width: 10em; text-align: center;"><code>==</code></th>
- <th scope="col" style="width: 10em; text-align: center;"><code>===</code></th>
- <th scope="col" style="width: 10em; text-align: center;"><code>Object.is</code></th>
+ <th scope="col">x</th>
+ <th scope="col">y</th>
+ <th scope="col"><code>==</code></th>
+ <th scope="col"><code>===</code></th>
+ <th scope="col"><code>Object.is</code></th>
</tr>
</thead>
<tbody>
<tr>
<td><code>undefined</code></td>
<td><code>undefined</code></td>
- <td style="background-color: rgb(144, 255, 144); text-align: center;"><code>true</code></td>
- <td style="background-color: rgb(144, 255, 144); text-align: center;"><code>true</code></td>
- <td style="background-color: rgb(144, 255, 144); text-align: center;"><code>true</code></td>
+ <td><code>true</code></td>
+ <td><code>true</code></td>
+ <td><code>true</code></td>
</tr>
<tr>
<td><code>null</code></td>
<td><code>null</code></td>
- <td style="background-color: rgb(144, 255, 144); text-align: center;"><code>true</code></td>
- <td style="background-color: rgb(144, 255, 144); text-align: center;"><code>true</code></td>
- <td style="background-color: rgb(144, 255, 144); text-align: center;"><code>true</code></td>
+ <td><code>true</code></td>
+ <td><code>true</code></td>
+ <td><code>true</code></td>
</tr>
<tr>
<td><code>true</code></td>
<td><code>true</code></td>
- <td style="background-color: rgb(144, 255, 144); text-align: center;"><code>true</code></td>
- <td style="background-color: rgb(144, 255, 144); text-align: center;"><code>true</code></td>
- <td style="background-color: rgb(144, 255, 144); text-align: center;"><code>true</code></td>
+ <td><code>true</code></td>
+ <td><code>true</code></td>
+ <td><code>true</code></td>
</tr>
<tr>
<td><code>false</code></td>
<td><code>false</code></td>
- <td style="background-color: rgb(144, 255, 144); text-align: center;"><code>true</code></td>
- <td style="background-color: rgb(144, 255, 144); text-align: center;"><code>true</code></td>
- <td style="background-color: rgb(144, 255, 144); text-align: center;"><code>true</code></td>
+ <td><code>true</code></td>
+ <td><code>true</code></td>
+ <td><code>true</code></td>
</tr>
<tr>
<td><code>"foo"</code></td>
<td><code>"foo"</code></td>
- <td style="background-color: rgb(144, 255, 144); text-align: center;"><code>true</code></td>
- <td style="background-color: rgb(144, 255, 144); text-align: center;"><code>true</code></td>
- <td style="background-color: rgb(144, 255, 144); text-align: center;"><code>true</code></td>
+ <td><code>true</code></td>
+ <td><code>true</code></td>
+ <td><code>true</code></td>
</tr>
<tr>
<td><code>0</code></td>
<td><code>0</code></td>
- <td style="background-color: rgb(144, 255, 144); text-align: center;"><code>true</code></td>
- <td style="background-color: rgb(144, 255, 144); text-align: center;"><code>true</code></td>
- <td style="background-color: rgb(144, 255, 144); text-align: center;"><code>true</code></td>
+ <td><code>true</code></td>
+ <td><code>true</code></td>
+ <td><code>true</code></td>
</tr>
<tr>
<td><code>+0</code></td>
<td><code>-0</code></td>
- <td style="background-color: rgb(144, 255, 144); text-align: center;"><code>true</code></td>
- <td style="background-color: rgb(144, 255, 144); text-align: center;"><code>true</code></td>
- <td style="background-color: rgb(255, 144, 144); text-align: center;"><code>false</code></td>
+ <td><code>true</code></td>
+ <td><code>true</code></td>
+ <td><code>false</code></td>
</tr>
<tr>
<td><code>0</code></td>
<td><code>false</code></td>
- <td style="background-color: rgb(144, 255, 144); text-align: center;"><code>true</code></td>
- <td style="background-color: rgb(255, 144, 144); text-align: center;"><code>false</code></td>
- <td style="background-color: rgb(255, 144, 144); text-align: center;"><code>false</code></td>
+ <td><code>true</code></td>
+ <td><code>false</code></td>
+ <td><code>false</code></td>
</tr>
<tr>
<td><code>""</code></td>
<td><code>false</code></td>
- <td style="background-color: rgb(144, 255, 144); text-align: center;"><code>true</code></td>
- <td style="background-color: rgb(255, 144, 144); text-align: center;"><code>false</code></td>
- <td style="background-color: rgb(255, 144, 144); text-align: center;"><code>false</code></td>
+ <td><code>true</code></td>
+ <td><code>false</code></td>
+ <td><code>false</code></td>
</tr>
<tr>
<td><code>""</code></td>
<td><code>0</code></td>
- <td style="background-color: rgb(144, 255, 144); text-align: center;"><code>true</code></td>
- <td style="background-color: rgb(255, 144, 144); text-align: center;"><code>false</code></td>
- <td style="background-color: rgb(255, 144, 144); text-align: center;"><code>false</code></td>
+ <td><code>true</code></td>
+ <td><code>false</code></td>
+ <td><code>false</code></td>
</tr>
<tr>
<td><code>"0"</code></td>
<td><code>0</code></td>
- <td style="background-color: rgb(144, 255, 144); text-align: center;"><code>true</code></td>
- <td style="background-color: rgb(255, 144, 144); text-align: center;"><code>false</code></td>
- <td style="background-color: rgb(255, 144, 144); text-align: center;"><code>false</code></td>
+ <td><code>true</code></td>
+ <td><code>false</code></td>
+ <td><code>false</code></td>
</tr>
<tr>
<td><code>"17"</code></td>
<td><code>17</code></td>
- <td style="background-color: rgb(144, 255, 144); text-align: center;"><code>true</code></td>
- <td style="background-color: rgb(255, 144, 144); text-align: center;"><code>false</code></td>
- <td style="background-color: rgb(255, 144, 144); text-align: center;"><code>false</code></td>
+ <td><code>true</code></td>
+ <td><code>false</code></td>
+ <td><code>false</code></td>
</tr>
<tr>
<td><code>[1,2]</code></td>
<td><code>"1,2"</code></td>
- <td style="background-color: rgb(144, 255, 144); text-align: center;"><code>true</code></td>
- <td style="background-color: rgb(255, 144, 144); text-align: center;"><code>false</code></td>
- <td style="background-color: rgb(255, 144, 144); text-align: center;"><code>false</code></td>
+ <td><code>true</code></td>
+ <td><code>false</code></td>
+ <td><code>false</code></td>
</tr>
<tr>
<td><code>new String("foo")</code></td>
<td><code>"foo"</code></td>
- <td style="background-color: rgb(144, 255, 144); text-align: center;"><code>true</code></td>
- <td style="background-color: rgb(255, 144, 144); text-align: center;"><code>false</code></td>
- <td style="background-color: rgb(255, 144, 144); text-align: center;"><code>false</code></td>
+ <td><code>true</code></td>
+ <td><code>false</code></td>
+ <td><code>false</code></td>
</tr>
<tr>
<td><code>null</code></td>
<td><code>undefined</code></td>
- <td style="background-color: rgb(144, 255, 144); text-align: center;"><code>true</code></td>
- <td style="background-color: rgb(255, 144, 144); text-align: center;"><code>false</code></td>
- <td style="background-color: rgb(255, 144, 144); text-align: center;"><code>false</code></td>
+ <td><code>true</code></td>
+ <td><code>false</code></td>
+ <td><code>false</code></td>
</tr>
<tr>
<td><code>null</code></td>
<td><code>false</code></td>
- <td style="background-color: rgb(255, 144, 144); text-align: center;"><code>false</code></td>
- <td style="background-color: rgb(255, 144, 144); text-align: center;"><code>false</code></td>
- <td style="background-color: rgb(255, 144, 144); text-align: center;"><code>false</code></td>
+ <td><code>false</code></td>
+ <td><code>false</code></td>
+ <td><code>false</code></td>
</tr>
<tr>
<td><code>undefined</code></td>
<td><code>false</code></td>
- <td style="background-color: rgb(255, 144, 144); text-align: center;"><code>false</code></td>
- <td style="background-color: rgb(255, 144, 144); text-align: center;"><code>false</code></td>
- <td style="background-color: rgb(255, 144, 144); text-align: center;"><code>false</code></td>
+ <td><code>false</code></td>
+ <td><code>false</code></td>
+ <td><code>false</code></td>
</tr>
<tr>
<td><code>{ foo: "bar" }</code></td>
<td><code>{ foo: "bar" }</code></td>
- <td style="background-color: rgb(255, 144, 144); text-align: center;"><code>false</code></td>
- <td style="background-color: rgb(255, 144, 144); text-align: center;"><code>false</code></td>
- <td style="background-color: rgb(255, 144, 144); text-align: center;"><code>false</code></td>
+ <td><code>false</code></td>
+ <td><code>false</code></td>
+ <td><code>false</code></td>
</tr>
<tr>
<td><code>new String("foo")</code></td>
<td><code>new String("foo")</code></td>
- <td style="background-color: rgb(255, 144, 144); text-align: center;"><code>false</code></td>
- <td style="background-color: rgb(255, 144, 144); text-align: center;"><code>false</code></td>
- <td style="background-color: rgb(255, 144, 144); text-align: center;"><code>false</code></td>
+ <td><code>false</code></td>
+ <td><code>false</code></td>
+ <td><code>false</code></td>
</tr>
<tr>
<td><code>0</code></td>
<td><code>null</code></td>
- <td style="background-color: rgb(255, 144, 144); text-align: center;"><code>false</code></td>
- <td style="background-color: rgb(255, 144, 144); text-align: center;"><code>false</code></td>
- <td style="background-color: rgb(255, 144, 144); text-align: center;"><code>false</code></td>
+ <td><code>false</code></td>
+ <td><code>false</code></td>
+ <td><code>false</code></td>
</tr>
<tr>
<td><code>0</code></td>
<td><code>NaN</code></td>
- <td style="background-color: rgb(255, 144, 144); text-align: center;"><code>false</code></td>
- <td style="background-color: rgb(255, 144, 144); text-align: center;"><code>false</code></td>
- <td style="background-color: rgb(255, 144, 144); text-align: center;"><code>false</code></td>
+ <td><code>false</code></td>
+ <td><code>false</code></td>
+ <td><code>false</code></td>
</tr>
<tr>
<td><code>"foo"</code></td>
<td><code>NaN</code></td>
- <td style="background-color: rgb(255, 144, 144); text-align: center;"><code>false</code></td>
- <td style="background-color: rgb(255, 144, 144); text-align: center;"><code>false</code></td>
- <td style="background-color: rgb(255, 144, 144); text-align: center;"><code>false</code></td>
+ <td><code>false</code></td>
+ <td><code>false</code></td>
+ <td><code>false</code></td>
</tr>
<tr>
<td><code>NaN</code></td>
<td><code>NaN</code></td>
- <td style="background-color: rgb(255, 144, 144); text-align: center;"><code>false</code></td>
- <td style="background-color: rgb(255, 144, 144); text-align: center;"><code>false</code></td>
- <td style="background-color: rgb(144, 255, 144); text-align: center;"><code>true</code></td>
+ <td><code>false</code></td>
+ <td><code>false</code></td>
+ <td><code>true</code></td>
</tr>
</tbody>
</table>
@@ -390,8 +390,6 @@ function attemptMutation(v)
<pre class="brush:js language-js"><code class="language-js">let stoppingForce = obj.mass * -obj.velocity</code></pre>
- <div class="line-number" style="top: 0px;"></div>
-
<p>如果<code>obj.velocity</code>是<code>0</code> (或计算结果为<code>0</code>), <code>一个-0</code>就在上处产生并被赋值为<code>stoppingForce的值</code>.</p>
</dd>
</dl>