Skip to content

Commit 09d02f8

Browse files
fix: sort portfolio companies alphabetically on geocities page
Modified buildGeoPage() function to sort portfolio companies by their display name using localeCompare() for proper alphabetical ordering. Fixes #93 Co-authored-by: grobie01 <grobie01@users.noreply.github.com>
1 parent 50ec29e commit 09d02f8

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

js/geo.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,10 @@ function buildGeoPage() {
55
whois.innerHTML = whoisRoot.split(" Try")[0];
66

77
const portfolioTable = document.getElementById("portfolio");
8-
for (p in portfolio) {
8+
const sortedPortfolioKeys = Object.keys(portfolio).sort((a, b) =>
9+
portfolio[a].name.localeCompare(portfolio[b].name)
10+
);
11+
for (const p of sortedPortfolioKeys) {
912
const row = portfolioTable.insertRow(-1);
1013
const logoCell = row.insertCell();
1114
const descriptionCell = row.insertCell();

0 commit comments

Comments
 (0)