- If
Type(x) is the same as Type(y), then
- Return the result of performing Strict Equality Comparison
x === y
- If
x is null and y is undefined, then
- Return
true.
- If
y is null and x is undefined, then
- Return
true.
- If
Type(x) is Number and Type(y) is String, then
- Return the result of the comparison
x == Number(y).
- If
Type(x) is String and Type(y) is Number, then
- Return the result of the comparison
Number(x) == y.
- If
Type(x) is BigInt and Type(y) is String, then
- Let
n be BigInt(y).
- If
n is NaN, then
- Return
false.
- Return the result of the comparison
x == n.
- If
Type(x) is String and Type(y) is BigInt, then
- Return the result of the comparison
y == x.
- If
Type(x) is Boolean, then
- Return the result of the comparison
Number(x) == y.
- If
Type(y) is Boolean, then
- Return the result of the comparison
x == Number(y).
- If
Type(x) is either String, Number, BigInt, or Symbol and Type(y) is Object, then
- Return the result of the comparison
x == ToPrimitive(y).
- If
Type(x) is Object and Type(y) is either String, Number, BigInt, or Symbol, then
- Return the result of the comparison
ToPrimitive(x) == y.
- If
Type(x) is BigInt and Type(y) is Number, or if Type(x) is Number and Type(y) is BigInt, then
- If
x or y are any of NaN, +∞, or -∞, then
- Return
false.
- If the mathematical value of
x is equal to the mathematical value of y, then
- Return
true.
- Return
false.
- Return
false.