So I have an array, for example -
[
{
"data": [
1, 2, 3
]
},
{
"data": [
2, 3, 4, 5
]
}
]
I need to sort the main array based on the length of data. So first comes the object with largest data array and last comes object with smallest data array, in this case it would be sorted in reverse order.
How can I do that?
JSFiddle: https://jsfiddle.net/tk7nybkq/