Object.is() and === - What is the difference?

Asked

Viewed 42 times

1

What would be the difference of the builder

Object.()

for the operator

===

Since both compare if two values are the same, the difference would only be the type of description when returning?

  • From what I read the main differences are: (NaN === NaN) === false and Object.is(NaN, NaN) === true, (+0 === -0) === true and Object.is(-0, +0) === false.

  • The question is not duplicate of this ? Although the title is different the same question is asked in the text : "Why Object.is, if I can compare the values with == or ===? If there is a difference between these forms, what are they?" and the answer addresses precisely this detail

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.