Ruby - Operators and Expressions
Given the array arr = [3, 1, 4, 1, 5], which code snippet correctly sorts the array in descending order using the spaceship operator?
Given the array arr = [3, 1, 4, 1, 5], which code snippet correctly sorts the array in descending order using the spaceship operator?
a and b. To sort descending, compare b to a.sort_by with spaceship operator.<=> [OK]15+ quiz questions · All difficulty levels · Free
Free Signup - Practice All Questions