Ruby | Array sort() function
Array#sort() : sort() is a Array class method which returns a new array created by sorting self Syntax: Array.sort() Parameter: Array Return: a new array created by sorting self Example #1 : Ruby # Ruby code for sort() method # declaring array a = ["abc", "nil", "dog"]