Ruby - Enumerable and Collection Processing
Which of these is a valid way to use
sort_by to sort an array of numbers nums by their absolute value?sort_by to sort an array of numbers nums by their absolute value?n.abs.abs is a method on numbers, so n.abs is correct. Other options misuse syntax or method names.element.method inside block for sorting [OK]15+ quiz questions · All difficulty levels · Free
Free Signup - Practice All Questions