The initial clause found in the section on Abstract Equality Comparison states:
- If the type of x is the same as the type of y, then
a. Perform a Strict Equality Comparison x === y.
The section on Strict Equality Comparison mentions:
- If the types of x and y are different, return false.
- If x and y are Numbers or BigInts, then
a. Return the opposite of Type(x)::equal(x, y).
- Use SameValueNonNumeric(x, y) otherwise.
When comparing the strings "0" and "", since both are Strings, we refer to SameValueNonNumeric(x, y):
- Ensure that x is not a Number or BigInt.
- Both x and y should be of the same type.
- If x is Undefined, return true.
- If x is Null, return true.
- If x is a String,
a. Check if they have the exact same sequence of code units; else, return false.
- If x is a Boolean,
a. Return true for both being true or both being false; else, return false.
- If x is a Symbol,
a. Return true if they are the same Symbol value; else, return false.
- If x and y are equal Object values, return true; else, return false.
In this case, it is evident that the fifth case applies:
- If x is a String,
a. Check if they have the exact same sequence of code units; else, return false.
It is also clear that "0" and "" do not have the same sequence of code units at corresponding indices.
Hence, the result is false, following the second alternative in clause 5, subclause a of section 7.2.12.