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)
};
Related Contents:
- JavaScript sorting and grouping items in array
- Sort array of objects by string property value
- How to sort an array of integers correctly
- Sort JavaScript object by key
- How to sort an array of objects by multiple fields?
- Javascript Array.sort implementation?
- Efficiently replace all accented characters in a string?
- How to sort 2 dimensional array by column value?
- How do you sort an array on multiple columns?
- Sorting a JavaScript object by property name
- How to sort an array of objects with jquery or javascript [duplicate]
- Sorting HTML table with JavaScript
- How can I convert the “arguments” object to an array in JavaScript?
- Sort mixed alpha/numeric array
- How to perform case-insensitive sorting array of string in JavaScript?
- Sort by two values prioritizing on one of them
- Javascript sort function. Sort by First then by Second
- Sorting options elements alphabetically using jQuery
- Sorting arrays numerically by object property value
- How to sort array inside collection record in MongoDB?
- Sorting in JavaScript: Should every compare function have a “return 0” statement?
- Sorting a JSON object in Javascript
- sort Javascript array by two numeric fields
- Sort Array by ISO 8601 date
- Sort an array by the “Levenshtein Distance” with best performance in Javascript
- How can you sort an array without mutating the original array?
- How to sort an associative array by its values in Javascript?
- Efficient way to insert a number into a sorted array of numbers?
- using lodash .groupBy. how to add your own keys for grouped output?
- Sorting of jqGrid (v4.1.2) treegrid not working with Ajacency Model
- What is the most efficient way to sort an Html Select’s Options by value, while preserving the currently selected item?
- How to sort numbers correctly with Array.sort()? [duplicate]
- orderBy multiple fields in Angular
- How can I compare software version number using JavaScript? (only numbers)
- sort json object in javascript
- Sort an array based on another array of integers
- JavaScript sort array by multiple (number) fields
- Underscore: sortBy() based on multiple attributes
- Any way to extend javascript’s array.sort() method to accept another parameter?
- Count unique elements in array without sorting
- Javascript – sorting array by multiple criteria
- 400x Sorting Speedup by Switching a.localeCompare(b) to (ab?1:0))
- Does .sort function change original array?
- javascript sort of HTML elements
- Javascript – Sort Array of objects by 2 Properties
- How to allow Web Workers to receive new data while it still performing computation?
- Reordering arrays
- sort outer array based on values in inner array, javascript
- Remove duplicate objects from an array using javascript
- Sort a dictionary by value in JavaScript