functiontoMarkdownTable(games) {if (!games.length) return"";// Get headers from the keys of the first objectconst headers =Object.keys(games[0]);// Build the header row and the separator rowconst headerRow =` | ${headers.join(" | ")} |`;const separatorRow =` | ${headers.map(() =>"---").join(" | ")} |`;// Build the data rowsconst dataRows = games.map( game =>` | ${headers.map(h => game[h]).join(" | ")} |` );// Join everything togetherreturn [headerRow, separatorRow,...dataRows].join("\n");}