Will it work? I have no fucking idea.

Is there a #Devstr?

const scoreDolphins = (calcAverage) => (44 + 23 + 71) / 3;

console.log(scoreDolphins());

const scoreKoalas = (calcAverage) => (65 + 54 + 49) / 3;

console.log(scoreKoalas());

const avgDolphins = scoreDolphins();

const avgKoalas = scoreKoalas();

function checkWinner() {

const winner = if(avgDolphins === avgKoalas * 2) {

console.log(‘Dolphins win! ${avgDolphins} vs ${avgKoalas}!’;

else if(avgKoalas === avgDolphins * 2) {

console.log(‘Koalas win! ${avgKoalas} vs. ${avgDolphins}’;

else {

console.log(‘No one wins…’);

return winner; }

checkWinner();

Reply to this note

Please Login to reply.

Discussion

No replies yet.