Ruby - Methods
Find the error in this Ruby code snippet:
arr = [1, 2, 3] arr.sort! puts arr
arr = [1, 2, 3] arr.sort! puts arr
sort! exists for arrayssort! method that sorts the array in place.arr.sort! without parentheses is valid syntax in Ruby.sort! exists and works on arrays [OK]sort! does not exist15+ quiz questions · All difficulty levels · Free
Free Signup - Practice All Questions