Courses / JavaScript
57. Array.prototype.sort()
Sorts the elements of an array in place and returns the sorted array.
1 min read Chapter 57 of 99
JavaScript
Array.prototype.sort()
Array.prototype.sort() arranges the elements of an array in a specified order.
"I need to display my list of items in alphabetical order, but how do I do that easily?"
Array.prototype.sort() sorts the elements of an array in place and returns the sorted array. It can sort strings and numbers based on a comparison function.
"I need to display my list of items in alphabetical order, but how do I do that easily?"
Array.prototype.sort() sorts the elements of an array in place and returns the sorted array. It can sort strings and numbers based on a comparison function.