Equality Expressions in Dart

What are Equality Expressions?

Equality expressions test objects for equality.

Equal to

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

Not equal to

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