Info
Open the page on your phone

Difference between == and === in JavaScript

In JavaScript, the == operator is used for abstract equality comparison, which means it tries to convert the operands to the same type before making the comparison. On the other hand, the === operator is used for strict equality comparison, which checks for both value and type equality without any conversions.

                        
For example, 5 == '5' would return true because the operands are converted to the same type (both are considered as equal). But 5 === '5' would return false because the operands are of different types.