DEV Community

Discussion on: Sorting in JavaScript

Collapse
 
curiousdev profile image
CuriousDev

While there are some good solutions for comparing strings and numbers, I think the possibility to customize the sort function is the most important part. With this you could for example sort a list of records depending on two or more properties.

Collapse
 
salehmubashar profile image
Saleh Mubashar

yes, the possibilities are endless if one understands the use of comparison functions, however I wanted to keep this post simple and give the common and easy to understand solution for sorting strings and numbers, which are more commonly used.
thanks