So I have some data that returns from a request that looks like this:
[{
subject: 'something',
email: 'someone@gmail.com',
name: 'Bert',
priority: '2'
},
{
subject: 'something else',
email: 'someoneelse@gmail.com',
name: 'Betty',
priority: '4'
},
{
subject: 'another thing',
email: 'anotherone@gmail.com',
name: 'Joanne',
priority: '1'
}];
But of course with a lot more items. So I'm looking to sort these items on 'priority' so the object with 4 comes first in the array. Any idea how to do this in javascript?