[
{
time: '5'
},
{
time: '2'
},
{
time: '3'
}
]
Let's say I have an array of objects. I want to sort it by time, ascending. How can I do that in javascript?
Is there a generic function?
Example
var sorted_array = sortByKey(my_array, 'time', 'asc');