Using JavaScript, I would like to know how to sort lexicographically an array of objects based on a string value in each object.
Consider:
[
{
"name" : "bob",
"count" : true
"birthday" : 1972
},
{
"name" : "jill",
"count" : false
"birthday" : 1922
},
{
"name" : "Gerald",
"count" : true
"birthday" : 1920
}
]
How can I sort the array alphabetically by name?
The name values are usernames, so I would like to maintain the letter casing.