You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// team1 < team2 && "Team 1 is more likely to win",
107
+
// team1 > team2 && "Team 2 is more likely to win"
108
+
// );
109
+
110
+
// ----------------------------------------
111
+
// Coding Challenge #2
112
+
// ----------------------------------------
113
+
114
+
/*
115
+
Let's continue with our football betting app!
116
+
1. Loop over the game.scored array and print each player name to the console, along with the goal number (Example: "Goal 1: Lewandowski")
117
+
2. Use a loop to calculate the average odd and log it to the console (We already studied how to calculate averages, you can go check if you don't remember)
118
+
3. Print the 3 odds to the console, but in a nice formatted way, exaclty like this:
119
+
Odd of victory Bayern Munich: 1.33
120
+
Odd of draw: 3.25
121
+
Odd of victory Borrussia Dortmund: 6.5
122
+
Get the team names directly from the game object, don't hardcode them (except for "draw"). HINT: Note how the odds and the game objects have the same property names 😉
123
+
BONUS: Create an object called 'scorers' which contains the names of the players who scored as properties, and the number of goals as the value. In this game, it will look like this:
0 commit comments