Equality (==) vs Strict Equality ( ===) vs Object.is() in JavaScript
SALESFORCE PREDATOR SALESFORCE PREDATOR
6.42K subscribers
738 views
21

 Published On Premiered Sep 4, 2021

== operator :
“==‘’ operator is used to compare two values.
It does not check the data type of operands while comparisons.
Rather it performs the type Coercion while comparing.

=== operator (strict equality ):
“===‘’ operator is also used to compare two values.
It checks not only the values but also types of two variables.
It does perform the type Coercion while comparing.

Object.is()
Object.is() overcomes the limitations of “===” operator.
Object.is(NaN, NaN) is true;
Object.is(0, -0) is false;
Rest all behavior is similar to that of strict equality operator.

Join Graphy/unacademy using this link https://www.graphy.com?fpr=pankaj96 and get best discounts on the courses.

show more

Share/Embed