JavaScript · Senior · Question 60 of 75

What does Object.is(-0, 0) return, and why does it exist?

Explanation

React and other libraries use Object.is to compare state. === says -0 === 0 and NaN !== NaN.

Further reading

Problem with a question

JavaScript · Senior · question 60

Test yourself

Take the JavaScript · Senior quiz: questions and options are shuffled, and you get a review of your mistakes at the end.

Take this quiz