var
a = ["a", "a"];
b = ["b", "b", "b", "b"],
c = ["c", "c", "c"],
d = ["d"],
container = [a, b, c, d];
​container.sort(function (a, b) {
return b.length - a.length;
});
console.log(container);
container
will be sorted from longest (most elements) to shortest (least number of elements). Access it as:
container[0] // longest
container[1] // 2nd longest
// ...
0
solved Sort Arrays By Their Length