import { dinoGameScoreboard } from "https://esm.town/v/rodrigotello/dinoGameScoreboard";
export function denoGameCurrentScoreboardLeader() {
let currentLeader = dinoGameScoreboard.reduce(
(highest, current) => {
if (current.score > highest.score) {
return current;
}
else {
return highest;
}
},
);
if (currentLeader.name.toLowerCase() === "rodrigo") {}
else {
console.email({
html: `<h1>${currentLeader.name} is the new leader</h1>`,
subject: "someone broke your record in deno game",
});
}
}