I've got an array that contains HTML code that I need to append somewhere on my page. These are text messages and I'm trying to get them sorted by date.
I took a look at a few different posts which described using jQuery.sort(), I've tried to implement it here:
function sortHtmlArray(array) {
array.sort((a, b) => a.find('.incoming-message-date') - b.find('.outgoing-message-date'));
}
But I'm clearly not doing it correct as it still sorts the same as below (out of order).
Where am I going wrong?
