const container = document.getElementById('proposals');
- parsedResponse.result.items.forEach((proposal) => {
+ parsedResponse.result.items
+ .sort((a, b) => b.total_occurrences - a.total_occurrences)
+ .forEach((proposal) => {
container.appendChild(generateProposalHTML(proposal));
});