Stačí změnit na:.sort(function(a, b) { return a.id.localeCompare(b.id); });Ale nebude to vypadat dobře.