array.sort(function(a, b){return b.length - a.length});
function sortByLength(arr) { return arr.sort((x,y) => x.length - y.length); }