Javascript fundamentals

What is the difference between == and === and Object.is in javascript?

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Equality_comparisons_and_sameness

  • double equals (==) will perform a type conversion when comparing two things, and will handle NaN, -0, and +0 specially to conform to IEEE 754 (so NaN != NaN, and -0 == +0);

  • triple equals (===) will do the same comparison (including the special handling for NaN, -0, and +0) but without type conversion, by simply always returning false if the types differ;

  • Object.is does no type conversion and no special handling for NaN, -0, and +0 (giving it the same behavior as === except on those special numeric values).

Why JavaScript has two zeros: -0 and +0?

https://abdulapopoola.com/2016/12/19/why-javascript-has-two-zeros-0-and-0/

So:
console.log(-0 == +0);; // true
console.log(-0 === +0); // true

0%