Mine's more verbose but still seems to work; the idea in all first 3 answers is to put the arrays into an additional array, then do a custom sort of the arrays based on their length. A good if somewhat dated reference is at: http://www.javascriptkit.com/javatutors/arraysort.shtml
var arrays = [a, b, c, d];
var concatentation = [];
arrays.sort(function(x, y) {
return y.length - x.length;
});
for (var i=0, n=arrays.length; i<n; i++) {
concatentation = concatentation.concat(arrays[i]);
}
console.log(concatentation); //[2, 3, 4, 5, 7, 8, 1, 6]