...

/

Comparison Operators

Comparison Operators

Learn about Ruby’s comparison operators.

In order to compare things, Ruby has a bunch of comparison operators.

The == operator

The == operator returns true if both objects are considered the same.

For example, 1 == 1 * 1 returns true because the numbers on both sides represent the same value. The expression "A" == "A" also returns true ...