Skip to content

Commit 51fc8e3

Browse files
committed
update destructuring coding challenge
1 parent dfc955d commit 51fc8e3

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

09-Data-Structure-Modern-Operators-and-Strings/challenge.js

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -86,9 +86,12 @@ const players1Final = [...player1, "Thiago", "Coutinho", "Perisic"];
8686
console.log(players1Final);
8787

8888
// 5.
89-
const {
90-
odds: { team1, x: draw, team2 },
91-
} = game;
89+
// const {
90+
// odds: { team1, x: draw, team2 },
91+
// } = game;
92+
93+
// or
94+
const { team1, x: draw, team2 } = game.odds;
9295
console.log(team1, draw, team2);
9396

9497
// 6.
@@ -100,7 +103,6 @@ printGoals(...game.scored);
100103

101104
// 7.
102105
console.log(
103-
game.odds.team1 < game.odds.team2 && "Team 1 is more likely to win",
104-
"\n",
105-
game.odds.team1 > game.odds.team2 && "Team 2 is more likely to win"
106+
team1 < team2 && "Team 1 is more likely to win",
107+
team1 > team2 && "Team 2 is more likely to win"
106108
);

0 commit comments

Comments
 (0)