Google News
logo
UI Developer - Interview Questions
State the difference between == and ===?
== denotes abstract equality operator, and it inspects if two values are equal or not apart from their data types. Automatically, it transforms the type of both the operands and compares them.
 
Example : 
1=='1';    //true
1==1;   // true
 
=== denotes identity equality operator, and it inspects the values of both the operands and their data type. The outcome of the operation will be true considering both the operands are equal and have the same data type, or else it returns false.
 
Example : 
1===1   //true
1==='1'   // false
Advertisement