+ 2

What is the use of <=> operator in ruby?

ruby operator <=> use!!!

5th Aug 2017, 1:39 PM
Vishal Agarwal
Vishal Agarwal - avatar
2 odpowiedzi
+ 11
a <=> b := if a < b then return -1 if a = b then return 0 if a > b then return 1 if a and b are not comparable then return nil https://stackoverflow.com/questions/827649/what-is-the-ruby-spaceship-operator
5th Aug 2017, 1:45 PM
Hatsy Rei
Hatsy Rei - avatar
+ 2
thank you 😊😊
5th Aug 2017, 1:46 PM
Vishal Agarwal
Vishal Agarwal - avatar