I have an array and I need to sort it in desc order, but it doesn't seem to work. What could I fix?
var array = [];
array['a'] = ['1','2','3'];
array['b'] = ['2','3'];
array['c'] = ['5','6','8','9'];
array.sort(function(a, b) {
return a.length < b.length ? -1 : (a.length > b.length ? 1 : 0);
});
console.log(array);