JavaScript Sorting Arrays

In JavaScript, The sort() method sorts the elements of an array alphabetically and returns the sorted array.

Code :