If the locale in your system is set correctly then you can use localeCompare
method instead of greater-than operator to compare the strings – this method is locale aware.
function sortComparer(a,b){
return a.title.localeCompare(b.title)
};
More Related Contents:
- Sort out array of object using its value [duplicate]
- Sort JavaScript object by key
- Sorting in JavaScript: Shouldn’t returning a boolean be enough for a comparison function?
- How to sort an array of objects by multiple fields?
- How may I sort a list alphabetically using jQuery?
- What is the stability of the Array.sort() method in different browsers?
- Sorting a JavaScript object by property name
- Sorting HTML table with JavaScript
- How can I convert the “arguments” object to an array in JavaScript?
- Sorting in JavaScript: Should every compare function have a “return 0” statement?
- Console.log showing only the updated version of the object printed
- Sort an array of object by a property (with custom order, not alphabetically)
- How to define custom sort function in javascript?
- Javascript sort function. Sort by First then by Second
- How to sort an associative array by its values in Javascript?
- using lodash .groupBy. how to add your own keys for grouped output?
- Sort an array based on another array of integers
- How to sort an array based on the length of each element?
- Sorting dropdown list using Javascript
- jQuery sort elements using data id
- Using Canvas to animate a sorting algorithm in JS
- Reordering arrays
- Javascript array sort and unique
- How to allow Web Workers to receive new data while it still performing computation?
- Sorting of jqGrid (v4.1.2) treegrid not working with Ajacency Model
- sort outer array based on values in inner array, javascript
- Javascript: Sort array and return an array of indices that indicates the position of the sorted elements with respect to the original elements
- Sorting strings in descending order in Javascript (Most efficiently)?
- Sorting an array of objects in Chrome
- How to sort a JavaScript array of objects by nested object property?