Concept Flow - Spaceship operator
Evaluate left expression
Evaluate right expression
Compare left and right
Return -1 if left < right
Return 0 if left == right
Return 1 if left > right
End
The spaceship operator compares two values and returns -1, 0, or 1 depending on whether the left value is less than, equal to, or greater than the right value.