Consider this array as an example -
[
{
"data": [
1, 2, 3
]
},
{
"data": [
2, 3, 4, 5
]
}
]
I want to arrange the main array based on the length of data. The object with the largest data array should come first, and the one with the smallest data array should come last.
Is there a way to achieve this?
JSFiddle: https://jsfiddle.net/tk7nybkq/