From 2f08db7f09c210c9f12e52fa82202959aa369d0b Mon Sep 17 00:00:00 2001 From: flifloo Date: Fri, 26 Mar 2021 23:11:35 +0100 Subject: [PATCH] Fix scoreboard sort --- sources/js/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/js/index.js b/sources/js/index.js index 68e0fc7..230d2f9 100644 --- a/sources/js/index.js +++ b/sources/js/index.js @@ -110,7 +110,7 @@ function updateLives(l) { function reloadScoreBoard() { scoreBoard.querySelectorAll("div").forEach(d => d.remove()); - for (const s of scores.sort(s => s.score).reverse()) { + for (const s of scores.sort((a, b) => a.score - b.score).reverse()) { const e = document.createElement("div"); e.classList.add("row-score"); const p1 = document.createElement("p");