Closed
Description
openedon Sep 19, 2019
What should each of the following evaluate to?
#[+0] == #[-0];
#[+0] === #[-0];
Object.is(#[+0], #[-0]);
#[NaN] == #[NaN];
#[NaN] === #[NaN];
Object.is(#[NaN], #[NaN]);
(For context, this is non-obvious because +0 === -0
is true
, Object.is(+0, -0)
is false
, NaN === NaN
is false
, and Object.is(NaN, NaN)
is true
.)
Personally I lean towards the -0
cases all being false
and the NaN
cases all being true
, so that the unusual equality semantics of -0
and NaN
do not propagate to the new kinds of objects being introduced by this proposal.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment