JSFiddle - React, Tailwind, and code Playground
by park kyungdoo
JavaScript
function uefaEuro2016(teams, scores){
// your code...
var first_team = [teams[0], scores[0]];
var second_team = [teams[1], scores[1]];
if (first_team[1] > second_team[1]) {
return 'At match ' + first_team[0] +' - '+ second_team[0] + ', ' + first_team[0] + ' won!';
}
else if (first_team[1] === second_team[1]) {
return 'At match ' + first_team[0] +' - '+ second_team[0] + ', teams played draw.';
}
else {
return 'At match ' + first_team[0] +' - ' + second_team[0] + ', ' + second_team[0] + ' won!';
}
}
uefaEuro2016(['Germany', 'Ukraine'], [2, 0]);