Ad
  • Custom User Avatar

    Yes, the spaceship operator is used for comparing two Ruby objects.

    It can return 3 possible values:

    • -1
    • 0
    • 1

    Where -1 means that the object on the right side of the operation is smaller than the other object.

    Then 0 means that the objects are equal.

    And 1 means the object on the right i greater then the other object.

  • Custom User Avatar

    can someone explain the spaceship operator?