Tarefa 3.4 — Solução
const melhorJogo = () => {
let melhor = jogos[0];
for (const jogo of jogos) {
if (jogo.nota > melhor.nota) {
melhor = jogo;
}
}
return melhor;
};
console.log(melhorJogo());
{ titulo: 'The Legend of Zelda: Breath of the Wild',
genero: 'Aventura', plataforma: 'Switch', nota: 9.8, ano: 2017 }