Beginner Ruby
Q18 / 100

What does the "<=>" operator (spaceship operator) return?

Correct! Well done.

Incorrect.

The correct answer is B) -1, 0, or 1 depending on whether the left operand is less than, equal to, or greater than the right

B

Correct Answer

-1, 0, or 1 depending on whether the left operand is less than, equal to, or greater than the right

Explanation

The spaceship operator returns -1, 0, or 1 for less than, equal, or greater than respectively, and is used to implement Comparable.

Progress
18/100