Ruby - Operators and Expressions
You want to sort an array of numbers in ascending order using the spaceship operator. Which code snippet correctly uses
<=> inside the sort method?<=> inside the sort method?sort takes two parameters and compares them with <=>.a <=> b for ascending order.15+ quiz questions · All difficulty levels · Free
Free Signup - Practice All Questions