Equality expressions test objects for equality.
The equal-to operator (==
) is to return true if both operands have the same value; otherwise, it returns false.
var a = 3;
var b = 3;
print(a == b); // true
The not-equal-to operator (!=
) is to return true if the operands do not have the same value; otherwise, it returns false.
var a = 3;
var b = 2;
print(a != b); // true