Equality (==) vs Strict Equality ( ===) vs Object.is() in JavaScript

Pubblicato il: 01 gennaio 1970
sul canale di: SALESFORCE PREDATOR
740
21

== 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.


In questa pagina del sito puoi guardare il video online Equality (==) vs Strict Equality ( ===) vs Object.is() in JavaScript della durata di ore minuti seconda in buona qualità , che l'utente ha caricato SALESFORCE PREDATOR 01 gennaio 1970, condividi il link con amici e conoscenti, su youtube questo video è già stato visto 740 volte e gli è piaciuto 21 spettatori. Buona visione!