JavaScript » Comparison » ==

This is the equal operator and returns a boolean true if both the operands are equal.

JavaScript will attempt to convert different data types to the same type in order to make the comparison.

Examples

Code:
a == 2
a == "2"
2 == '2'
Explanation:

Assuming 'a' to be 2 and 'b' to be 4, these examples will return a value of true.