Skip to content

Commit

Permalink
Add BigInt to JS “Equality comparisons and sameness” table (#2285)
Browse files Browse the repository at this point in the history
Fixes #2237
  • Loading branch information
black-tmin-oil authored and sideshowbarker committed Mar 9, 2021
1 parent d714a90 commit 6d9b05b
Showing 1 changed file with 19 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ <h2 id="Loose_equality_using">Loose equality using ==</h2>
<thead>
<tr>
<th scope="row"></th>
<th colspan="7" scope="col" style="text-align: center;">Operand B</th>
<th colspan="8" scope="col" style="text-align: center;">Operand B</th>
</tr>
</thead>
<tbody>
Expand All @@ -87,16 +87,18 @@ <h2 id="Loose_equality_using">Loose equality using ==</h2>
<td style="text-align: center;">String</td>
<td style="text-align: center;">Boolean</td>
<td style="text-align: center;">Object</td>
<td style="text-align: center;">BigInt</td>
</tr>
<tr>
<th rowspan="6" scope="row">Operand A</th>
<th rowspan="7" scope="row">Operand 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>false</code></td>
<td style="text-align: center;"><code>false</code></td>
</tr>
<tr>
<td>Null</td>
Expand All @@ -106,6 +108,7 @@ <h2 id="Loose_equality_using">Loose equality using ==</h2>
<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>false</code></td>
</tr>
<tr>
<td>Number</td>
Expand All @@ -115,6 +118,7 @@ <h2 id="Loose_equality_using">Loose equality using ==</h2>
<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 style="text-align: center;"><code>ℝ(A) = ℝ(B)</code></td>
</tr>
<tr>
<td>String</td>
Expand All @@ -124,6 +128,7 @@ <h2 id="Loose_equality_using">Loose equality using ==</h2>
<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>A == ToPrimitive(B)</code></td>
<td style="text-align: center;"><code>StringToBigInt(A) === B</code></td>
</tr>
<tr>
<td>Boolean</td>
Expand All @@ -133,6 +138,7 @@ <h2 id="Loose_equality_using">Loose equality using ==</h2>
<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 style="text-align: center;"><code>ToNumber(A) == B</code></td>
</tr>
<tr>
<td>Object</td>
Expand All @@ -142,6 +148,17 @@ <h2 id="Loose_equality_using">Loose equality using ==</h2>
<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;"><code>A === B</code></td>
<td style="text-align: center;"><code>ToPrimitive(A) == B</code></td>
</tr>
<tr>
<td>BigInt</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 === StringToBigInt(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 style="text-align: center;"><code>A === B</code></td>
</tr>
</tbody>
</table>
Expand Down

0 comments on commit 6d9b05b

Please sign in to comment.