Here is a concrete, working example, using Array.prototype.sort
:
const arr = [
[500, 'Foo'],
[600, 'bar'],
[700, 'Baz']
];
arr.sort((a,b) => a[1].toUpperCase().localeCompare(b[1].toUpperCase()));
console.log(arr);
More Related Contents:
- use Lodash to sort array of object by value
- Sort out array of object using its value [duplicate]
- consider a string which has question marks, numbers , letters [closed]
- How to sort an array of objects by multiple fields?
- What is the stability of the Array.sort() method in different browsers?
- How can I convert the “arguments” object to an array in JavaScript?
- Sort an array of object by a property (with custom order, not alphabetically)
- How do I sort an array of objects based on the ordering of another array?
- Javascript sort function. Sort by First then by Second
- sort Javascript array by two numeric fields
- How to sort an associative array by its values in Javascript?
- using lodash .groupBy. how to add your own keys for grouped output?
- Comparing two arrays of objects, and exclude the elements who match values into new array in JS
- Sort an array based on another array of integers
- How to sort an array based on the length of each element?
- Does .sort function change original array?
- How to merge multiple array of object by ID in javascript?
- Reordering arrays
- Filter array of objects whose any properties contains a value
- Merge Array of Objects by Property using Lodash
- Javascript array sort and unique
- Sort an array to have specific items first in the array
- Javascript – sorting array by multiple criteria
- Sort an array of objects by multiple properties
- Sort a Javascript Array by frequency and then filter repeats
- Filter nested array in object array by array of values
- Lodash create collection from duplicate object keys
- Using lodash to compare jagged arrays (items existence without order)
- How to sort a JavaScript array of objects by nested object property?
- Array of object deep comparison with lodash