I have the following array of JSON objects:
[
{
term: 'summer'
},
{
term: 'winter'
},
{
term: 'fall'
},
{
term: 'summer'
},
{
term: 'summer'
}
]
I was wondering how can order this array to be arranged by specific order of the term
keys. For example the requested order is object with winter
will be first then fall
and then summer
.
So the expected result should be:
[
{
term: 'winter'
},
{
term: 'fall'
},
{
term: 'summer'
},
{
term: 'summer'
},
{
term: 'summer'
}
]
Please advise how can I order the array to result in the expected array.