From 910bdeaeb023ed509452f9ff80bfbbf626b06fbc Mon Sep 17 00:00:00 2001 From: Ben Beltran Date: Tue, 7 Apr 2020 00:08:49 +0200 Subject: Sort by votes --- index.html | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'index.html') diff --git a/index.html b/index.html index bc3f8b6..d839fe2 100644 --- a/index.html +++ b/index.html @@ -45,7 +45,9 @@ 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)); }); -- cgit