re: Coercion in JavaScript. VIEW POST

FULL DISCUSSION
 

Cool post, Uddesh!

I have a note on this paragraph.

console.log('100' === 100) // False

In the case of triple equal, the result will be False because triple equal operator strictly checks the type of left and right side.

In fact, we can say that triple equal checks value with coercion "disabled". On the other hand double equal allows coercion.

 

Yes, This also can be a case but as far as I concerned triple equal checks the type of the value of left and right side.

 

The triple equal checks both the value and the type, so in this example's case, the values are equal but the types aren't, so the output is false (false(type) & true(value) => 0 & 1 == 0 => false).

code of conduct - report abuse