12
I realized that Javascript now has the Object.is
and, according to the documentation:
Object.is
determines whether two values correspond to the same value.
Some doubts have arisen about this:
Why
Object.is
, if I can compare the values with==
or===
? If there’s a difference between these forms, what are they?Somehow,
Object.is
has some resemblance to the operatorinstanceof
? This doubt came to me, because generallyis
is used in some languages to check if a given value corresponds to a given object.What benefits
Object.is
brings Javascript?
To whom it concerns, there is an article in MDN dealing with: Comparisons of equality and uniformity
– Woss
Wallace, I’m sorry. I had made the translation as a response and would adjust it to clear your doubts...
– RXSD
@Andréfilipe is all right. We only warned, because this practice here on the site results in removal of the response and, in more serious cases, even punishment by ban. It was good for us to warn.
– Wallace Maxters
It’s worth taking a look at the goal: @Andréfilipe: About copying articles
– Wallace Maxters