
Object-Oriented JavaScript - Second Edition
By :

There's another set of operators that all return a Boolean value as a result of the operation. These are the comparison operators. The following table lists them together with example uses:
Operator symbol |
Description |
Example |
---|---|---|
|
Equality comparison: Returns true when both operands are equal. The operands are converted to the same type before being compared. Also called loose comparison. |
> 1 == 1;
true
> 1 == 2;
false
> 1 == '1';
true
|
|
Equality and type comparison: Returns |
> 1 === '1';
false
> 1 === 1;
true
|
|
Non-equality comparison: Returns |
> 1 != 1;
false
> 1 != '1';
false
> 1 != '2';
true
|
|
Non-equality comparison without type conversion: Returns... |
Change the font size
Change margin width
Change background colour