Author name: lahin

JavaScript .sort() method

JavaScript has a built-in sort prototype method. Which can be used to sort elements of an array. When we call .sort() method of an array of numbers or strings JavaScript automatically sort the array.